From 8a2acbffc86012de3523ecf91db2c4ea1b1c4ea2 Mon Sep 17 00:00:00 2001 From: Mark Adler Date: Fri, 9 Sep 2011 23:13:27 -0700 Subject: zlib 1.0-pre --- minigzip.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'minigzip.c') diff --git a/minigzip.c b/minigzip.c index 48c21d5..fa0a188 100644 --- a/minigzip.c +++ b/minigzip.c @@ -1,5 +1,5 @@ /* minigzip.c -- simulate gzip using the zlib compression library - * Copyright (C) 1995-1996 Jean-loup Gailly. + * Copyright (C) 1995 Jean-loup Gailly. * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -52,7 +52,7 @@ extern int unlink OF((const char *)); char *prog; -void error OF((const char *msg)); +void error OF((char *msg)); void gz_compress OF((FILE *in, gzFile out)); void gz_uncompress OF((gzFile in, FILE *out)); void file_compress OF((char *file)); @@ -63,7 +63,7 @@ int main OF((int argc, char *argv[])); * Display error message and exit */ void error(msg) - const char *msg; + char *msg; { fprintf(stderr, "%s: %s\n", prog, msg); exit(1); @@ -88,7 +88,7 @@ void gz_compress(in, out) } if (len == 0) break; - if (gzwrite(out, buf, (unsigned)len) != len) error(gzerror(out, &err)); + if (gzwrite(out, buf, len) != len) error(gzerror(out, &err)); } fclose(in); if (gzclose(out) != Z_OK) error("failed gzclose"); @@ -110,9 +110,7 @@ void gz_uncompress(in, out) if (len < 0) error (gzerror(in, &err)); if (len == 0) break; - if ((int)fwrite(buf, 1, (unsigned)len, out) != len) { - error("failed fwrite"); - } + if (fwrite(buf, 1, len, out) != (uInt)len) error("failed fwrite"); } if (fclose(out)) error("failed fclose"); -- cgit v1.2.3-55-g6feb