diff options
Diffstat (limited to 'gzread.c')
-rw-r--r-- | gzread.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -91,8 +91,8 @@ local int gz_look(state) | |||
91 | /* allocate read buffers and inflate memory */ | 91 | /* allocate read buffers and inflate memory */ |
92 | if (state->size == 0) { | 92 | if (state->size == 0) { |
93 | /* allocate buffers */ | 93 | /* allocate buffers */ |
94 | state->in = malloc(state->want); | 94 | state->in = (unsigned char *)malloc(state->want); |
95 | state->out = malloc(state->want << 1); | 95 | state->out = (unsigned char *)malloc(state->want << 1); |
96 | if (state->in == NULL || state->out == NULL) { | 96 | if (state->in == NULL || state->out == NULL) { |
97 | if (state->out != NULL) | 97 | if (state->out != NULL) |
98 | free(state->out); | 98 | free(state->out); |
@@ -353,14 +353,14 @@ int ZEXPORT gzread(file, buf, len) | |||
353 | 353 | ||
354 | /* large len -- read directly into user buffer */ | 354 | /* large len -- read directly into user buffer */ |
355 | else if (state->how == COPY) { /* read directly */ | 355 | else if (state->how == COPY) { /* read directly */ |
356 | if (gz_load(state, buf, len, &n) == -1) | 356 | if (gz_load(state, (unsigned char *)buf, len, &n) == -1) |
357 | return -1; | 357 | return -1; |
358 | } | 358 | } |
359 | 359 | ||
360 | /* large len -- decompress directly into user buffer */ | 360 | /* large len -- decompress directly into user buffer */ |
361 | else { /* state->how == GZIP */ | 361 | else { /* state->how == GZIP */ |
362 | strm->avail_out = len; | 362 | strm->avail_out = len; |
363 | strm->next_out = buf; | 363 | strm->next_out = (unsigned char *)buf; |
364 | if (gz_decomp(state) == -1) | 364 | if (gz_decomp(state) == -1) |
365 | return -1; | 365 | return -1; |
366 | n = state->x.have; | 366 | n = state->x.have; |
@@ -523,7 +523,7 @@ char * ZEXPORT gzgets(file, buf, len) | |||
523 | 523 | ||
524 | /* look for end-of-line in current output buffer */ | 524 | /* look for end-of-line in current output buffer */ |
525 | n = state->x.have > left ? left : state->x.have; | 525 | n = state->x.have > left ? left : state->x.have; |
526 | eol = memchr(state->x.next, '\n', n); | 526 | eol = (unsigned char *)memchr(state->x.next, '\n', n); |
527 | if (eol != NULL) | 527 | if (eol != NULL) |
528 | n = (unsigned)(eol - state->x.next) + 1; | 528 | n = (unsigned)(eol - state->x.next) + 1; |
529 | 529 | ||