summaryrefslogtreecommitdiff
path: root/gzio.c
diff options
context:
space:
mode:
Diffstat (limited to 'gzio.c')
-rw-r--r--gzio.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/gzio.c b/gzio.c
index b488e96..365b6f5 100644
--- a/gzio.c
+++ b/gzio.c
@@ -71,8 +71,9 @@ local int destroy (s)
71 if (s->file != NULL && fclose(s->file)) { 71 if (s->file != NULL && fclose(s->file)) {
72 err = Z_ERRNO; 72 err = Z_ERRNO;
73 } 73 }
74 if (s->z_err < 0) err = s->z_err;
74 zcfree((voidp)0, s); 75 zcfree((voidp)0, s);
75 return s->z_err < 0 ? s->z_err : err; 76 return err;
76} 77}
77 78
78/* =========================================================================== 79/* ===========================================================================
@@ -235,9 +236,10 @@ int gzread (file, buf, len)
235 236
236 if (s->transparent) { 237 if (s->transparent) {
237 unsigned n = 0; 238 unsigned n = 0;
239 Byte *b = (Byte*)buf;
238 /* Copy the first two (non-magic) bytes if not done already */ 240 /* Copy the first two (non-magic) bytes if not done already */
239 while (s->stream.avail_in > 0 && len > 0) { 241 while (s->stream.avail_in > 0 && len > 0) {
240 *((Byte*)buf)++ = *s->stream.next_in++; 242 *b++ = *s->stream.next_in++;
241 s->stream.avail_in--; 243 s->stream.avail_in--;
242 len--; n++; 244 len--; n++;
243 } 245 }
@@ -364,7 +366,7 @@ local void putLong (file, x)
364{ 366{
365 int n; 367 int n;
366 for (n = 0; n < 4; n++) { 368 for (n = 0; n < 4; n++) {
367 fputc(x & 0xff, file); 369 fputc((int)(x & 0xff), file);
368 x >>= 8; 370 x >>= 8;
369 } 371 }
370} 372}