]> git.ipfire.org Git - thirdparty/git.git/commitdiff
http.c: Spell the null pointer as NULL
authorRamsay Jones <ramsay@ramsay1.demon.co.uk>
Thu, 24 Oct 2013 20:17:19 +0000 (21:17 +0100)
committerJunio C Hamano <gitster@pobox.com>
Thu, 24 Oct 2013 21:42:26 +0000 (14:42 -0700)
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>
Acked-by: Jeff King <peff@peff.net>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
http.c

diff --git a/http.c b/http.c
index 5199e602beef2f0b44020689874b090be631471f..3447945ee4f4e0e4b273d979ea1805b4c0f63b4c 100644 (file)
--- a/http.c
+++ b/http.c
@@ -1072,7 +1072,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;