aboutsummaryrefslogtreecommitdiff
path: root/zlib/test/minigzip.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2013-11-12 13:48:44 +0100
committermarha <marha@users.sourceforge.net>2013-11-12 13:51:05 +0100
commit4bdf8409331f44417c3622bc5ec0e42c0e68afb6 (patch)
treeee8a24a92b267f48542eaed1968266a76e945a27 /zlib/test/minigzip.c
parentb73c544c61712f7bd57f3c9a0f6046481f58038b (diff)
downloadvcxsrv-4bdf8409331f44417c3622bc5ec0e42c0e68afb6.tar.gz
vcxsrv-4bdf8409331f44417c3622bc5ec0e42c0e68afb6.tar.bz2
vcxsrv-4bdf8409331f44417c3622bc5ec0e42c0e68afb6.zip
Updated zlib to 1.2.8
Diffstat (limited to 'zlib/test/minigzip.c')
-rw-r--r--zlib/test/minigzip.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/zlib/test/minigzip.c b/zlib/test/minigzip.c
index aa7ac7a04..b3025a489 100644
--- a/zlib/test/minigzip.c
+++ b/zlib/test/minigzip.c
@@ -40,6 +40,10 @@
# define SET_BINARY_MODE(file)
#endif
+#ifdef _MSC_VER
+# define snprintf _snprintf
+#endif
+
#ifdef VMS
# define unlink delete
# define GZ_SUFFIX "-gz"
@@ -463,8 +467,12 @@ void file_compress(file, mode)
exit(1);
}
+#if !defined(NO_snprintf) && !defined(NO_vsnprintf)
+ snprintf(outfile, sizeof(outfile), "%s%s", file, GZ_SUFFIX);
+#else
strcpy(outfile, file);
strcat(outfile, GZ_SUFFIX);
+#endif
in = fopen(file, "rb");
if (in == NULL) {
@@ -499,7 +507,11 @@ void file_uncompress(file)
exit(1);
}
+#if !defined(NO_snprintf) && !defined(NO_vsnprintf)
+ snprintf(buf, sizeof(buf), "%s", file);
+#else
strcpy(buf, file);
+#endif
if (len > SUFFIX_LEN && strcmp(file+len-SUFFIX_LEN, GZ_SUFFIX) == 0) {
infile = file;
@@ -508,7 +520,11 @@ void file_uncompress(file)
} else {
outfile = file;
infile = buf;
+#if !defined(NO_snprintf) && !defined(NO_vsnprintf)
+ snprintf(buf + len, sizeof(buf) - len, "%s", GZ_SUFFIX);
+#else
strcat(infile, GZ_SUFFIX);
+#endif
}
in = gzopen(infile, "rb");
if (in == NULL) {
@@ -546,7 +562,11 @@ int main(argc, argv)
gzFile file;
char *bname, outmode[20];
+#if !defined(NO_snprintf) && !defined(NO_vsnprintf)
+ snprintf(outmode, sizeof(outmode), "%s", "wb6 ");
+#else
strcpy(outmode, "wb6 ");
+#endif
prog = argv[0];
bname = strrchr(argv[0], '/');