summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorMark Adler <madler@alumni.caltech.edu>2012-08-14 00:29:58 -0700
committerMark Adler <madler@alumni.caltech.edu>2012-08-14 00:29:58 -0700
commitaa210a1b84615440e0f7fb84e03e0a5f17872279 (patch)
tree2e1a95547a53c8a0a0fec229d53f62ed71946210 /examples
parent360c3e9532a7086ed252e3ab187d03fb6b86c4ca (diff)
downloadzlib-aa210a1b84615440e0f7fb84e03e0a5f17872279.tar.gz
Fix example/gzappend.c for proper z_const usage.
Diffstat (limited to 'examples')
-rw-r--r--examples/gzappend.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/examples/gzappend.c b/examples/gzappend.c
index e9e878e..0fc42b9 100644
--- a/examples/gzappend.c
+++ b/examples/gzappend.c
@@ -1,7 +1,7 @@
/* gzappend -- command to append to a gzip file
- Copyright (C) 2003 Mark Adler, all rights reserved
- version 1.1, 4 Nov 2003
+ Copyright (C) 2003, 2012 Mark Adler, all rights reserved
+ version 1.2, 13 Aug 2012
This software is provided 'as-is', without any express or implied
warranty. In no event will the author be held liable for any damages
@@ -39,6 +39,7 @@
* - Keep gzip file clean on appended file read errors
* - Use in-place rotate instead of auxiliary buffer
* (Why you ask? Because it was fun to write!)
+ * 1.2 13 Aug 2012 - Fix for proper z_const usage
*/
/*
@@ -170,7 +171,7 @@ typedef struct {
int size; /* 1 << size is bytes in buf */
unsigned left; /* bytes available at next */
unsigned char *buf; /* buffer */
- unsigned char *next; /* next byte in buffer */
+ z_const unsigned char *next; /* next byte in buffer */
char *name; /* file name for error messages */
} file;
@@ -467,7 +468,7 @@ int main(int argc, char **argv)
z_stream strm;
/* ignore command name */
- argv++;
+ argc--; argv++;
/* provide usage if no arguments */
if (*argv == NULL) {