Skip to content

Commit 5ba1a8a

Browse files
Ramsay Jonespeff
authored andcommitted
builtin/config.c: Fix a sparse warning
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 <[email protected]> Signed-off-by: Jeff King <[email protected]>
1 parent e895589 commit 5ba1a8a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

builtin/config.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ static int collect_config(const char *key_, const char *value_, void *cb)
165165
static int get_value(const char *key_, const char *regex_)
166166
{
167167
int ret = CONFIG_GENERIC_ERROR;
168-
struct strbuf_list values = {0};
168+
struct strbuf_list values = {NULL};
169169
int i;
170170

171171
if (use_key_regexp) {

0 commit comments

Comments
 (0)