Skip to contentSkip to conversation

Fix a "Using plain integer as NULL pointer" sparse warning

PATCH In review Ramsay Jones 2 participants 2 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix a "Using plain integer as NULL pointer" sparse warning

---

Hi Jeff,

If you need to re-roll your run-command patch [commit b0984f82, "run-command: treat inaccessible directories as ENOENT", 30-03-2012], could you please squash this patch into it. Thanks!

ATB,
Ramsay Jones

 run-command.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
run-command.c +1 -1
index 47afb78..ae72b9b 100644
@@ -86,7 +86,7 @@ static char *locate_in_PATH(const char *file)
 	struct strbuf buf = STRBUF_INIT;
 
 	if (!p || !*p)
-		return 0;
+		return NULL;
 
 	while (1) {
 		const char *end = strchrnul(p, ':');
Signature · 1 line
1.7.9
#1 lore raw
Quoted 3 lines · Ramsay Jones

If you need to re-roll your run-command patch [commit b0984f82, "run-command: treat inaccessible directories as ENOENT", 30-03-2012], could you please squash this patch into it. Thanks!

I don't think it needs re-rolled, but it hasn't hit next yet. Junio, can you squash this in?

run-command.c static char *locate_in_PATH(const char *file) · line 89

Quoted 10 lines
run-command.c +1 -1
index 47afb78..ae72b9b 100644
@@ -86,7 +86,7 @@ static char *locate_in_PATH(const char *file)
 	struct strbuf buf = STRBUF_INIT;
 
 	if (!p || !*p)
-		return 0;
+		return NULL;

I missed this when converting the code from "is there anything in path" to "here is what there is in path".

-Peff