Skip to contentSkip to conversation

clone: don't use an integer as a NULL pointer

PATCH In review Ramsay Jones 2 participants 3 messages Jun 16, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 clone: don't use an integer as a NULL pointer

---

Hi Stefan,

If you need to re-roll your 'sb/submodule-default-paths' branch, could you please squash this into the relevant patch. (commit 8efbe28b, "clone: add --init-submodule=<pathspec> switch", 23-05-2016).

Thanks!

ATB,
Ramsay Jones

 builtin/clone.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
builtin/clone.c +1 -1
index 22b6eac..a056f72 100644
@@ -925,7 +925,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 		struct strbuf sb = STRBUF_INIT;
 		for_each_string_list_item(item, &init_submodules) {
 			strbuf_addf(&sb, "submodule.defaultUpdatePath=%s", item->string);
-			string_list_append(&option_config, strbuf_detach(&sb, 0));
+			string_list_append(&option_config, strbuf_detach(&sb, NULL));
 		}
 	}
 
Signature · 1 line
2.8.0
#1 lore raw
Quoted 6 lines · Ramsay Jones

---

Hi Stefan,

Quoted 8 lines

If you need to re-roll your 'sb/submodule-default-paths' branch, could you please squash this into the relevant patch. (commit 8efbe28b, "clone: add --init-submodule=<pathspec> switch", 23-05-2016).

Thanks!

ATB,
Ramsay Jones

Thanks for pointing out!

I am sorry for having you write me these emails; Out of curiosity, how much of this is manual work and how much did you automate of this?

Quoted 19 lines
 builtin/clone.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
builtin/clone.c +1 -2
index 22b6eac..a056f72 100644
@@ -925,7 +925,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
                struct strbuf sb = STRBUF_INIT;
                for_each_string_list_item(item, &init_submodules) {
                        strbuf_addf(&sb, "submodule.defaultUpdatePath=%s", item->string);
-                       string_list_append(&option_config, strbuf_detach(&sb, 0));
+                       string_list_append(&option_config, strbuf_detach(&sb, NULL));
                }
        }
 
--

2.8.0

#2 lore raw
Quoted 12 lines · Stefan Beller
Quoted 10 lines · Ramsay Jones

---

Hi Stefan,

If you need to re-roll your 'sb/submodule-default-paths' branch, could you please squash this into the relevant patch. (commit 8efbe28b, "clone: add --init-submodule=<pathspec> switch", 23-05-2016).

Quoted 8 lines
Quoted 4 lines

Thanks!

ATB,
Ramsay Jones

Thanks for pointing out!

I am sorry for having you write me these emails;

It's no problem ...

Quoted 2 lines

Out of curiosity, how much of this is manual work and how much did you automate of this?

... because this particular problem is caught by 'make sparse'.

[OK, I have to write the patch, test, etc. manually, but that's not a great burden.]

ATB,
Ramsay Jones