Skip to content

Commit

Permalink
builtin/config.c: Fix a sparse warning
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ramsay Jones authored and Jeff King committed Oct 29, 2012
1 parent e895589 commit 5ba1a8a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion builtin/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 5ba1a8a

Please sign in to comment.