Skip to content

Commit 79b5c5a

Browse files
committed
Use snprintf() for later versions of Microsoft C.
1 parent ee7d7b5 commit 79b5c5a

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

gzguts.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,10 @@
103103
# endif
104104
#endif
105105

106-
/* unlike snprintf (which is required in C99, yet still not supported by
107-
Microsoft more than a decade later!), _snprintf does not guarantee null
108-
termination of the result -- however this is only used in gzlib.c where
106+
/* unlike snprintf (which is required in C99), _snprintf does not guarantee
107+
null termination of the result -- however this is only used in gzlib.c where
109108
the result is assured to fit in the space provided */
110-
#ifdef _MSC_VER
109+
#if defined(_MSC_VER) && _MSC_VER < 1900
111110
# define snprintf _snprintf
112111
#endif
113112

test/minigzip.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
# define SET_BINARY_MODE(file)
4141
#endif
4242

43-
#ifdef _MSC_VER
43+
#if defined(_MSC_VER) && _MSC_VER < 1900
4444
# define snprintf _snprintf
4545
#endif
4646

0 commit comments

Comments
 (0)