diff options
| -rw-r--r-- | gzread.c | 10 |
1 files changed, 6 insertions, 4 deletions
| @@ -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) |
