summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Moinvaziri <nathan@nathanm.com>2021-06-04 15:24:23 -0700
committerHans Kristian Rosbach <hk-git@circlestorm.org>2021-06-13 20:57:36 +0200
commit64380644b0964020c9d89ecb97965f732cac0470 (patch)
treeb23186fbf6cfb5cff764e9a3ea050752a2737182
parentc79998f79069b3d0c6ec9a319beeba9da4feb421 (diff)
Only need to add rem if it is greater than zero in chunkmemset.
-rw-r--r--chunkset_tpl.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/chunkset_tpl.h b/chunkset_tpl.h
index 96f08d1..ae049e7 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;
}