diff options
author | Sebastian Pop <s.pop@samsung.com> | 2019-03-06 14:00:30 -0600 |
---|---|---|
committer | Hans Kristian Rosbach <hk-github@circlestorm.org> | 2019-03-21 11:22:36 +0100 |
commit | a1d4af095bef56c42b168ebdb53b545af8f82c5f (patch) | |
tree | d097a5d9bb4fe4b8f5c60dca8edadf283973e5d0 /inflate.c | |
parent | 9f6bacbfed2a6da3734a273be28b1891bb4d0dfb (diff) |
factor out code
Diffstat (limited to 'inflate.c')
-rw-r--r-- | inflate.c | 12 |
1 files changed, 4 insertions, 8 deletions
@@ -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; |