From: Nathan Moinvaziri Date: Fri, 4 Jun 2021 22:24:23 +0000 (-0700) Subject: Only need to add rem if it is greater than zero in chunkmemset. X-Git-Tag: 2.0.5~13 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=64380644b0964020c9d89ecb97965f732cac0470;p=thirdparty%2Fzlib-ng.git Only need to add rem if it is greater than zero in chunkmemset. --- diff --git a/chunkset_tpl.h b/chunkset_tpl.h index 96f08d11..ae049e7e 100644 --- a/chunkset_tpl.h +++ b/chunkset_tpl.h @@ -153,9 +153,10 @@ Z_INTERNAL uint8_t* CHUNKMEMSET(uint8_t *out, unsigned dist, unsigned len) { } /* Last, deal with the case when LEN is not a multiple of SZ. */ - if (rem) + if (rem) { memcpy(out, from, rem); - out += rem; + out += rem; + } return out; }