git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] mailmap.c: Fix a sparse warning

From
Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Date
Dec 15, 2012, 19:25 UTC
Message-ID
<50CCCEA1.1020000@ramsay1.demon.co.uk>

In particular, sparse issues an "Using plain integer as NULL pointer" warning (line 214), since an integer zero is passed as the second actual argument in a strbuf_detach() call. The expected type for this parameter is 'size_t *'. In order to suppress the warning, we simply pass a NULL pointer constant instead.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
---
Hi Antoine,

When you re-roll your mailmap patches (branch 'ap/log-mailmap') could you please squash this into commit a09b6cd9 ("mailmap: Remove buffer length limit in map_user", 11-12-2012).

Thanks!

ATB, Ramsay Jones

 mailmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mailmap.c b/mailmap.c
index e636278..0608eb3 100644
--- a/mailmap.c
+++ b/mailmap.c
@@ -211,7 +211,7 @@ int map_user(struct string_list *map,
 	for (i = 0; i < end_of_email - email; i++)
 		strbuf_addch(&buf, tolower(email[i]));
 	strbuf_addch(&buf, 0);
-	mailbuf = strbuf_detach(&buf, 0);
+	mailbuf = strbuf_detach(&buf, NULL);
 
 	debug_mm("map_user: map '%s' <%s>\n", name, mailbuf);
 	item = string_list_lookup(map, mailbuf);
-- 
1.8.0
Message 1 of 1 in “mailmap.c: Fix a sparse warning”
  1. mailmap.c: Fix a sparse warningRamsay Jones, Dec 15, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.