diff options
author | Mark Adler <madler@alumni.caltech.edu> | 2011-09-09 23:27:17 -0700 |
---|---|---|
committer | Mark Adler <madler@alumni.caltech.edu> | 2011-09-09 23:27:17 -0700 |
commit | e0ff940e1adb68d3575705ebf1546d9f07ad3b4a (patch) | |
tree | 792ac6996d1225c0955027050296126bc8ff6e26 /gzread.c | |
parent | 7df877eccdd826e94df53215f65dee639428e83f (diff) | |
download | zlib-e0ff940e1adb68d3575705ebf1546d9f07ad3b4a.tar.gz zlib-e0ff940e1adb68d3575705ebf1546d9f07ad3b4a.tar.bz2 zlib-e0ff940e1adb68d3575705ebf1546d9f07ad3b4a.zip |
zlib 1.2.3.8v1.2.3.8
Diffstat (limited to 'gzread.c')
-rw-r--r-- | gzread.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -14,7 +14,7 @@ local int gz_next4 OF((gz_statep, unsigned long *)); | |||
14 | local int gz_head OF((gz_statep)); | 14 | local int gz_head OF((gz_statep)); |
15 | local int gz_decomp OF((gz_statep)); | 15 | local int gz_decomp OF((gz_statep)); |
16 | local int gz_make OF((gz_statep)); | 16 | local int gz_make OF((gz_statep)); |
17 | local int gz_skip OF((gz_statep, z_off_t)); | 17 | local int gz_skip OF((gz_statep, z_off64_t)); |
18 | 18 | ||
19 | /* Use read() to load a buffer -- return -1 on error, otherwise 0. Read from | 19 | /* Use read() to load a buffer -- return -1 on error, otherwise 0. Read from |
20 | state->fd, and update state->eof, state->err, and state->msg as appropriate. | 20 | state->fd, and update state->eof, state->err, and state->msg as appropriate. |
@@ -330,7 +330,7 @@ local int gz_make(state) | |||
330 | /* Skip len uncompressed bytes of output. Return -1 on error, 0 on success. */ | 330 | /* Skip len uncompressed bytes of output. Return -1 on error, 0 on success. */ |
331 | local int gz_skip(state, len) | 331 | local int gz_skip(state, len) |
332 | gz_statep state; | 332 | gz_statep state; |
333 | z_off_t len; | 333 | z_off64_t len; |
334 | { | 334 | { |
335 | unsigned n; | 335 | unsigned n; |
336 | 336 | ||
@@ -338,7 +338,8 @@ local int gz_skip(state, len) | |||
338 | while (len) | 338 | while (len) |
339 | /* skip over whatever is in output buffer */ | 339 | /* skip over whatever is in output buffer */ |
340 | if (state->have) { | 340 | if (state->have) { |
341 | n = state->have > len ? (unsigned)len : state->have; | 341 | n = GT_OFF(state->have) || (z_off64_t)state->have > len ? |
342 | (unsigned)len : state->have; | ||
342 | state->have -= n; | 343 | state->have -= n; |
343 | state->next += n; | 344 | state->next += n; |
344 | state->pos += n; | 345 | state->pos += n; |