]> git.lizzy.rs Git - zlib.git/commitdiff
Use snprintf() for later versions of Microsoft C.
authorMark Adler <madler@alumni.caltech.edu>
Sat, 31 Dec 2016 01:13:31 +0000 (17:13 -0800)
committerMark Adler <madler@alumni.caltech.edu>
Sat, 31 Dec 2016 01:13:31 +0000 (17:13 -0800)
gzguts.h
test/minigzip.c

index 4f83d6d1dd33d9b59a595fe01950739906657651..f7287923a9ea58e6dc13fb8839a267488ffcff19 100644 (file)
--- a/gzguts.h
+++ b/gzguts.h
 #  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
 
index 6c64cc7d6423b04aa4237bbceb4c24c46b9915ef..26c44ff9a69fe3df0ef35e7fae3e766d0fd6293b 100644 (file)
@@ -40,7 +40,7 @@
 #  define SET_BINARY_MODE(file)
 #endif
 
-#ifdef _MSC_VER
+#if defined(_MSC_VER) && _MSC_VER < 1900
 #  define snprintf _snprintf
 #endif