From: Mark Adler Date: Sat, 31 Dec 2016 01:13:31 +0000 (-0800) Subject: Use snprintf() for later versions of Microsoft C. X-Git-Tag: v1.2.9~13 X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=79b5c5acf0dff798f3436126b080472ef6b7bd65;p=zlib.git Use snprintf() for later versions of Microsoft C. --- diff --git a/gzguts.h b/gzguts.h index 4f83d6d..f728792 100644 --- a/gzguts.h +++ b/gzguts.h @@ -103,11 +103,10 @@ # endif #endif -/* unlike snprintf (which is required in C99, yet still not supported by - Microsoft more than a decade later!), _snprintf does not guarantee null - termination of the result -- however this is only used in gzlib.c where +/* unlike snprintf (which is required in C99), _snprintf does not guarantee + null termination of the result -- however this is only used in gzlib.c where the result is assured to fit in the space provided */ -#ifdef _MSC_VER +#if defined(_MSC_VER) && _MSC_VER < 1900 # define snprintf _snprintf #endif diff --git a/test/minigzip.c b/test/minigzip.c index 6c64cc7..26c44ff 100644 --- a/test/minigzip.c +++ b/test/minigzip.c @@ -40,7 +40,7 @@ # define SET_BINARY_MODE(file) #endif -#ifdef _MSC_VER +#if defined(_MSC_VER) && _MSC_VER < 1900 # define snprintf _snprintf #endif