aboutsummaryrefslogtreecommitdiff
path: root/gzread.c
diff options
context:
space:
mode:
authorMark Adler <madler@alumni.caltech.edu>2011-09-09 23:27:17 -0700
committerMark Adler <madler@alumni.caltech.edu>2011-09-09 23:27:17 -0700
commite0ff940e1adb68d3575705ebf1546d9f07ad3b4a (patch)
tree792ac6996d1225c0955027050296126bc8ff6e26 /gzread.c
parent7df877eccdd826e94df53215f65dee639428e83f (diff)
downloadzlib-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.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gzread.c b/gzread.c
index 74322ca..a560c16 100644
--- a/gzread.c
+++ b/gzread.c
@@ -14,7 +14,7 @@ local int gz_next4 OF((gz_statep, unsigned long *));
14local int gz_head OF((gz_statep)); 14local int gz_head OF((gz_statep));
15local int gz_decomp OF((gz_statep)); 15local int gz_decomp OF((gz_statep));
16local int gz_make OF((gz_statep)); 16local int gz_make OF((gz_statep));
17local int gz_skip OF((gz_statep, z_off_t)); 17local 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. */
331local int gz_skip(state, len) 331local 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;