]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Only need to add rem if it is greater than zero in chunkmemset.
authorNathan Moinvaziri <nathan@nathanm.com>
Fri, 4 Jun 2021 22:24:23 +0000 (15:24 -0700)
committerHans Kristian Rosbach <hk-git@circlestorm.org>
Sun, 13 Jun 2021 18:57:36 +0000 (20:57 +0200)
chunkset_tpl.h

index 96f08d118ed788de24c1ed4d7f65c4592f645431..ae049e7e7c9b4a9ed4f57b69c395516f90c95571 100644 (file)
@@ -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;
 }