ccan: Fix calling memset with zero length parameter
[ccan] / ccan / tally / tally.c
index 774373ca0f88e0b4a48bed5029107cf28bded0d1..29f055588015f5e38f02513c6dcce39b4657ff20 100644 (file)
@@ -506,11 +506,11 @@ char *tally_histogram(const struct tally *tally,
 
                if (count > covered) {
                        count -= covered;
+                       memset(p, '*', count);
                } else {
                        count = 0;
                }
 
-               memset(p, '*', count);
                p += count;
                *p = '\n';
                p++;