From: Junio C Hamano Date: Fri, 10 Dec 2010 07:42:05 +0000 (-0800) Subject: fetch_populated_submodules(): document dynamic allocation X-Git-Tag: v1.7.4-rc0~31^2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=1c1f3537c0283c92abbca9155813ed62b05cb481;p=git.git fetch_populated_submodules(): document dynamic allocation ... while fixing a miscounting. Signed-off-by: Junio C Hamano --- diff --git a/submodule.c b/submodule.c index 4e62900af..6f1c10722 100644 --- a/submodule.c +++ b/submodule.c @@ -264,7 +264,8 @@ int fetch_populated_submodules(int num_options, const char **options, if (read_cache() < 0) die("index file corrupt"); - argv = xcalloc(num_options + 5, sizeof(const char *)); + /* 4: "fetch" (options) "--submodule-prefix" prefix NULL */ + argv = xcalloc(num_options + 4, sizeof(const char *)); argv[argc++] = "fetch"; for (i = 0; i < num_options; i++) argv[argc++] = options[i];