summaryrefslogtreecommitdiff
path: root/gzio.c
diff options
context:
space:
mode:
Diffstat (limited to 'gzio.c')
-rw-r--r--gzio.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gzio.c b/gzio.c
index 6c3211a..1f5e130 100644
--- a/gzio.c
+++ b/gzio.c
@@ -3,7 +3,7 @@
3 * For conditions of distribution and use, see copyright notice in zlib.h 3 * For conditions of distribution and use, see copyright notice in zlib.h
4 */ 4 */
5 5
6/* $Id: gzio.c,v 1.5 1995/04/29 17:13:56 jloup Exp $ */ 6/* $Id: gzio.c,v 1.6 1995/04/30 19:52:21 jloup Exp $ */
7 7
8#include <stdio.h> 8#include <stdio.h>
9 9
@@ -128,7 +128,7 @@ local gzFile gz_open (path, mode, fd)
128 128
129 if (s->mode == 'w') { 129 if (s->mode == 'w') {
130 err = deflateInit2(&(s->stream), Z_DEFAULT_COMPRESSION, 130 err = deflateInit2(&(s->stream), Z_DEFAULT_COMPRESSION,
131 DEFLATED, -WBITS, MEM_LEVEL, 0); 131 DEFLATED, -MAX_WBITS, MAX_MEM_LEVEL, 0);
132 /* windowBits is passed < 0 to suppress zlib header */ 132 /* windowBits is passed < 0 to suppress zlib header */
133 133
134 s->stream.next_out = s->outbuf = ALLOC(Z_BUFSIZE); 134 s->stream.next_out = s->outbuf = ALLOC(Z_BUFSIZE);
@@ -137,7 +137,7 @@ local gzFile gz_open (path, mode, fd)
137 return destroy(s), (gzFile)Z_NULL; 137 return destroy(s), (gzFile)Z_NULL;
138 } 138 }
139 } else { 139 } else {
140 err = inflateInit2(&(s->stream), -WBITS); 140 err = inflateInit2(&(s->stream), -MAX_WBITS);
141 s->stream.next_in = s->inbuf = ALLOC(Z_BUFSIZE); 141 s->stream.next_in = s->inbuf = ALLOC(Z_BUFSIZE);
142 142
143 if (err != Z_OK || s->inbuf == Z_NULL) { 143 if (err != Z_OK || s->inbuf == Z_NULL) {
@@ -249,7 +249,7 @@ int gzread (file, buf, len)
249 len--; n++; 249 len--; n++;
250 } 250 }
251 if (len == 0) return n; 251 if (len == 0) return n;
252 return n + fread(buf, 1, len, s->file); 252 return n + fread(b, 1, len, s->file);
253 } 253 }
254 if (s->z_err == Z_DATA_ERROR) return -1; /* bad .gz file */ 254 if (s->z_err == Z_DATA_ERROR) return -1; /* bad .gz file */
255 if (s->z_err == Z_STREAM_END) return 0; /* don't read crc as data */ 255 if (s->z_err == Z_STREAM_END) return 0; /* don't read crc as data */