From: Sebastian Pop Date: Wed, 6 Mar 2019 20:00:30 +0000 (-0600) Subject: factor out code X-Git-Tag: 1.9.9-b1~507 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a1d4af095bef56c42b168ebdb53b545af8f82c5f;p=thirdparty%2Fzlib-ng.git factor out code --- diff --git a/inflate.c b/inflate.c index c4241cc6..293081ab 100644 --- a/inflate.c +++ b/inflate.c @@ -1164,25 +1164,21 @@ int ZEXPORT PREFIX(inflate)(PREFIX3(stream) *strm, int flush) { copy = state->length; if (copy > left) copy = left; - left -= copy; - state->length -= copy; if (copy >= sizeof(uint64_t)) put = chunk_memcpy(put, from, copy); else put = copy_bytes(put, from, copy); } else { /* copy from output */ - unsigned offset = state->offset; - from = put - offset; copy = state->length; if (copy > left) copy = left; - left -= copy; - state->length -= copy; if (copy >= sizeof(uint64_t)) - put = chunk_memset(put, from, offset, copy); + put = chunk_memset(put, put - state->offset, state->offset, copy); else - put = set_bytes(put, from, offset, copy); + put = set_bytes(put, put - state->offset, state->offset, copy); } + left -= copy; + state->length -= copy; if (state->length == 0) state->mode = LEN; break;