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

[PATCH] http.c: Spell the null pointer as NULL

From
Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Date
Oct 24, 2013, 20:17 UTC
Message-ID
<5269804F.2080800@ramsay1.demon.co.uk>

Commit 1bbcc224 ("http: refactor options to http_get_*", 28-09-2013) changed the type of final 'options' argument of the http_get_file() function from an int to an 'struct http_get_options' pointer. However, it neglected to update the (single) call site. Since this call was passing '0' to that argument, it was (correctly) being interpreted as a null pointer. Change to argument to NULL.

Noticed by sparse. ("Using plain integer as NULL pointer")
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
---
Hi Junio,
This is a repost of:
  http://article.gmane.org/gmane.comp.version-control.git/236201

I suspect that this simply fell through the cracks ... (if not, please let me know ;-)

ATB, Ramsay Jones

 http.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/http.c b/http.c
index 96d7578..b133ffd 100644
--- a/http.c
+++ b/http.c
@@ -1045,7 +1045,7 @@ static char *fetch_pack_index(unsigned char *sha1, const char *base_url)
 	strbuf_addf(&buf, "%s.temp", sha1_pack_index_name(sha1));
 	tmp = strbuf_detach(&buf, NULL);
 
-	if (http_get_file(url, tmp, 0) != HTTP_OK) {
+	if (http_get_file(url, tmp, NULL) != HTTP_OK) {
 		error("Unable to get pack index %s", url);
 		free(tmp);
 		tmp = NULL;
-- 
1.8.4
Next: Jonathan Nieder
Message 1 of 3 in “http.c: Spell the null pointer as NULL”
  1. http.c: Spell the null pointer as NULLRamsay Jones, Oct 24, 2013
  2. Jonathan NiederOct 24, 2013
  3. Junio C HamanoOct 24, 2013

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.