aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gzread.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/gzread.c b/gzread.c
index 2d4ca42..d2ab6b1 100644
--- a/gzread.c
+++ b/gzread.c
@@ -50,10 +50,12 @@ local int gz_avail(gz_statep state) {
50 if (strm->avail_in) { /* copy what's there to the start */ 50 if (strm->avail_in) { /* copy what's there to the start */
51 unsigned char *p = state->in; 51 unsigned char *p = state->in;
52 unsigned const char *q = strm->next_in; 52 unsigned const char *q = strm->next_in;
53 unsigned n = strm->avail_in; 53 if (q != p) {
54 do { 54 unsigned n = strm->avail_in;
55 *p++ = *q++; 55 do {
56 } while (--n); 56 *p++ = *q++;
57 } while (--n);
58 }
57 } 59 }
58 if (gz_load(state, state->in + strm->avail_in, 60 if (gz_load(state, state->in + strm->avail_in,
59 state->size - strm->avail_in, &got) == -1) 61 state->size - strm->avail_in, &got) == -1)