{"thread":{"id":"32353","subject":"[PATCH] mailmap.c: Fix a sparse warning","startedAt":"2012-12-15T19:25:21Z","lastAt":"2012-12-15T19:25:21Z","messageCount":1,"participants":["Ramsay Jones"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"204940","messageId":"50CCCEA1.1020000@ramsay1.demon.co.uk","threadId":"32353","inReplyTo":null,"subject":"[PATCH] mailmap.c: Fix a sparse warning","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2012-12-15T19:25:21Z","receivedAt":"2012-12-15T19:25:21Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\nIn particular, sparse issues an \"Using plain integer as NULL pointer\"\nwarning (line 214), since an integer zero is passed as the second\nactual argument in a strbuf_detach() call. The expected type for\nthis parameter is 'size_t *'. In order to suppress the warning, we\nsimply pass a NULL pointer constant instead.\n\nSigned-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n---\n\nHi Antoine,\n\nWhen you re-roll your mailmap patches (branch 'ap/log-mailmap') could\nyou please squash this into commit a09b6cd9 (\"mailmap: Remove buffer\nlength limit in map_user\", 11-12-2012).\n\nThanks!\n\nATB,\nRamsay Jones\n\n mailmap.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/mailmap.c b/mailmap.c\nindex e636278..0608eb3 100644\n--- a/mailmap.c\n+++ b/mailmap.c\n@@ -211,7 +211,7 @@ int map_user(struct string_list *map,\n \tfor (i = 0; i < end_of_email - email; i++)\n \t\tstrbuf_addch(&buf, tolower(email[i]));\n \tstrbuf_addch(&buf, 0);\n-\tmailbuf = strbuf_detach(&buf, 0);\n+\tmailbuf = strbuf_detach(&buf, NULL);\n \n \tdebug_mm(\"map_user: map '%s' <%s>\\n\", name, mailbuf);\n \titem = string_list_lookup(map, mailbuf);\n-- \n1.8.0\n"}]}