diff options
| author | Conrad Meyer <cem@FreeBSD.org> | 2018-10-22 20:00:30 +0000 |
|---|---|---|
| committer | Conrad Meyer <cem@FreeBSD.org> | 2018-10-22 20:00:30 +0000 |
| commit | 706cfae467a217cc786fd96a72cc2e33c61987e4 (patch) | |
| tree | e7673904660df47b5abd9a1c33cf982a514dac66 /zlibWrapper/examples/minigzip.c | |
| parent | 42239e68a5cfba3b37b054425eace8d14e0844e3 (diff) | |
Notes
Diffstat (limited to 'zlibWrapper/examples/minigzip.c')
| -rw-r--r-- | zlibWrapper/examples/minigzip.c | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/zlibWrapper/examples/minigzip.c b/zlibWrapper/examples/minigzip.c index 521d047117c51..f67be09564f25 100644 --- a/zlibWrapper/examples/minigzip.c +++ b/zlibWrapper/examples/minigzip.c @@ -18,6 +18,8 @@ /* @(#) $Id$ */ +#define _POSIX_SOURCE /* fileno */ + #include "zstd_zlibwrapper.h" #include <stdio.h> @@ -470,12 +472,8 @@ 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) { @@ -510,11 +508,7 @@ 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; @@ -523,11 +517,7 @@ 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) { @@ -565,11 +555,7 @@ 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], '/'); |
