Use snprintf with Win build

This commit is contained in:
Eric Blankenhorn
2019-03-06 14:55:51 -06:00
parent d61684f210
commit 934c1b7952
2 changed files with 11 additions and 10 deletions

View File

@ -124,6 +124,11 @@ static int loggingEnabled = 0;
static struct log mynewt_log;
#endif /* WOLFSSL_APACHE_MYNEWT */
#ifdef _MSC_VER
/* 4996 warning to use MS extensions e.g., sprintf_s instead of XSPRINTF */
#pragma warning(disable: 4996)
#endif /* _MSC_VER */
#endif /* DEBUG_WOLFSSL */

View File

@ -382,17 +382,13 @@
/* snprintf is used in asn.c for GetTimeString, PKCS7 test, and when
debugging is turned on */
#ifndef USE_WINDOWS_API
#if defined(NO_FILESYSTEM) && (defined(OPENSSL_EXTRA) || \
defined(HAVE_PKCS7)) && !defined(NO_STDIO_FILESYSTEM)
/* case where stdio is not included else where but is needed for
* snprintf */
#include <stdio.h>
#endif
#define XSNPRINTF snprintf
#else
#define XSNPRINTF _snprintf
#if defined(NO_FILESYSTEM) && (defined(OPENSSL_EXTRA) || \
defined(HAVE_PKCS7)) && !defined(NO_STDIO_FILESYSTEM)
/* case where stdio is not included else where but is needed for
* snprintf */
#include <stdio.h>
#endif
#define XSNPRINTF snprintf
#if defined(WOLFSSL_CERT_EXT) || defined(HAVE_ALPN)
/* use only Thread Safe version of strtok */