diff options
author | Mark Adler <madler@alumni.caltech.edu> | 2016-12-30 17:13:31 -0800 |
---|---|---|
committer | Mark Adler <madler@alumni.caltech.edu> | 2016-12-30 17:13:31 -0800 |
commit | 79b5c5acf0dff798f3436126b080472ef6b7bd65 (patch) | |
tree | d82603b72c81decc752819cc8079bb9cd40ea324 | |
parent | ee7d7b5dda25c111e61e19ac7b476c26aa6f3020 (diff) | |
download | zlib-79b5c5acf0dff798f3436126b080472ef6b7bd65.tar.gz zlib-79b5c5acf0dff798f3436126b080472ef6b7bd65.tar.bz2 zlib-79b5c5acf0dff798f3436126b080472ef6b7bd65.zip |
Use snprintf() for later versions of Microsoft C.
-rw-r--r-- | gzguts.h | 7 | ||||
-rw-r--r-- | test/minigzip.c | 2 |
2 files changed, 4 insertions, 5 deletions
@@ -103,11 +103,10 @@ | |||
103 | # endif | 103 | # endif |
104 | #endif | 104 | #endif |
105 | 105 | ||
106 | /* unlike snprintf (which is required in C99, yet still not supported by | 106 | /* unlike snprintf (which is required in C99), _snprintf does not guarantee |
107 | Microsoft more than a decade later!), _snprintf does not guarantee null | 107 | null termination of the result -- however this is only used in gzlib.c where |
108 | termination of the result -- however this is only used in gzlib.c where | ||
109 | the result is assured to fit in the space provided */ | 108 | the result is assured to fit in the space provided */ |
110 | #ifdef _MSC_VER | 109 | #if defined(_MSC_VER) && _MSC_VER < 1900 |
111 | # define snprintf _snprintf | 110 | # define snprintf _snprintf |
112 | #endif | 111 | #endif |
113 | 112 | ||
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 @@ | |||
40 | # define SET_BINARY_MODE(file) | 40 | # define SET_BINARY_MODE(file) |
41 | #endif | 41 | #endif |
42 | 42 | ||
43 | #ifdef _MSC_VER | 43 | #if defined(_MSC_VER) && _MSC_VER < 1900 |
44 | # define snprintf _snprintf | 44 | # define snprintf _snprintf |
45 | #endif | 45 | #endif |
46 | 46 | ||