Browse Source

ccan: Fix calling memset with zero length parameter

Signed-off-by: Volker Lendecke <vl@samba.org>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Volker Lendecke 12 years ago
parent
commit
5628cd2c21
1 changed files with 1 additions and 1 deletions
  1. 1 1
      ccan/tally/tally.c

+ 1 - 1
ccan/tally/tally.c

@@ -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++;