builtin/config.c: Fix a sparse warning
authorRamsay Jones <ramsay@ramsay1.demon.co.uk>
Sun, 28 Oct 2012 21:05:25 +0000 (21:05 +0000)
committerJeff King <peff@peff.net>
Mon, 29 Oct 2012 05:48:06 +0000 (01:48 -0400)
Sparse issues an "Using plain integer as NULL pointer" warning while
checking a 'struct strbuf_list' initializer expression. The initial
field of the struct has pointer type, but the initializer expression
is given as '{0}'. In order to suppress the warning, we simply replace
the initializer with '{NULL}'.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Jeff King <peff@peff.net>
builtin/config.c
index f881053cbbf6eec551aadf7280bc0e58717235ec..e796af4db6c533a936ecfc70d36e936a8fffa4bd 100644 (file)
@@ -165,7 +165,7 @@ static int collect_config(const char *key_, const char *value_, void *cb)
 static int get_value(const char *key_, const char *regex_)
 {
        int ret = CONFIG_GENERIC_ERROR;
-       struct strbuf_list values = {0};
+       struct strbuf_list values = {NULL};
        int i;
 
        if (use_key_regexp) {