{"thread":{"id":"35145","subject":"[PATCH] http.c: Spell the null pointer as NULL","startedAt":"2013-10-15T21:55:02Z","lastAt":"2013-10-15T23:02:54Z","messageCount":3,"participants":["Ramsay Jones","Jeff King","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"229026","messageId":"525DB9B6.8040701@ramsay1.demon.co.uk","threadId":"35145","inReplyTo":null,"subject":"[PATCH] http.c: Spell the null pointer as NULL","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2013-10-15T21:55:02Z","receivedAt":"2013-10-15T21:55:02Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\nCommit 1bbcc224 (\"http: refactor options to http_get_*\", 28-09-2013)\nchanged the type of final 'options' argument of the http_get_file()\nfunction from an int to an 'struct http_get_options' pointer.\nHowever, it neglected to update the (single) call site. Since this\ncall was passing '0' to that argument, it was (correctly) being\ninterpreted as a null pointer. Change to argument to NULL.\n\nNoticed by sparse. (\"Using plain integer as NULL pointer\")\n\nSigned-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n---\n\nHi Jonathan, Junio,\n\nI'm a little puzzled by not having noticed this until this evening! ;-)\nAlso, I note that maint@kernel.org != maint@repo.or.cz/jrn\n\nATB,\nRamsay Jones\n\n http.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/http.c b/http.c\nindex 96d7578..b133ffd 100644\n--- a/http.c\n+++ b/http.c\n@@ -1045,7 +1045,7 @@ static char *fetch_pack_index(unsigned char *sha1, const char *base_url)\n \tstrbuf_addf(&buf, \"%s.temp\", sha1_pack_index_name(sha1));\n \ttmp = strbuf_detach(&buf, NULL);\n \n-\tif (http_get_file(url, tmp, 0) != HTTP_OK) {\n+\tif (http_get_file(url, tmp, NULL) != HTTP_OK) {\n \t\terror(\"Unable to get pack index %s\", url);\n \t\tfree(tmp);\n \t\ttmp = NULL;\n-- \n1.8.4\n"},{"id":"229029","messageId":"20131015220326.GA4927@sigill.intra.peff.net","threadId":"35145","inReplyTo":"525DB9B6.8040701@ramsay1.demon.co.uk","subject":"Re: [PATCH] http.c: Spell the null pointer as NULL","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2013-10-15T22:03:26Z","receivedAt":"2013-10-15T22:03:26Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Oct 15, 2013 at 10:55:02PM +0100, Ramsay Jones wrote:\n\n> Commit 1bbcc224 (\"http: refactor options to http_get_*\", 28-09-2013)\n> changed the type of final 'options' argument of the http_get_file()\n> function from an int to an 'struct http_get_options' pointer.\n> However, it neglected to update the (single) call site. Since this\n> call was passing '0' to that argument, it was (correctly) being\n> interpreted as a null pointer. Change to argument to NULL.\n\nThanks, patch is obviously correct (and the cause was just oversight on\nmy part).\n\n-Peff\n"},{"id":"229041","messageId":"xmqqzjqa9ly9.fsf@gitster.dls.corp.google.com","threadId":"35145","inReplyTo":"525DB9B6.8040701@ramsay1.demon.co.uk","subject":"Re: [PATCH] http.c: Spell the null pointer as NULL","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-10-15T23:02:54Z","receivedAt":"2013-10-15T23:02:54Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ramsay Jones <ramsay@ramsay1.demon.co.uk> writes:\n\n> Also, I note that maint@kernel.org != maint@repo.or.cz/jrn\n\nThanks.\n"}]}