From: Rusty Russell Date: Tue, 4 Aug 2009 02:28:22 +0000 (+0930) Subject: stringmap: fail path can print uninitialized var in test. X-Git-Url: https://git.ozlabs.org/?p=ccan;a=commitdiff_plain;h=f9757c15a7b61cd4042c060b9fd0e069cb2c31df;hp=ccce1aa254cb9c7a2796e3171c7146703ab7ae40 stringmap: fail path can print uninitialized var in test. --- diff --git a/ccan/stringmap/test/run.c b/ccan/stringmap/test/run.c index 52309c26..0d4db567 100644 --- a/ccan/stringmap/test/run.c +++ b/ccan/stringmap/test/run.c @@ -243,7 +243,7 @@ static int test_stringmap(size_t count, FILE *out) { struct test_entry *entries = block_pool_alloc(bp, sizeof(*entries) * count); struct test_entry *i, *e = entries+count, *o; char *value_base = block_pool_alloc(bp, count), *value = value_base; - size_t unique_count; + size_t unique_count = 0; //we use value to track whether an entry has been added or not memset(value, 0, count);