Skip to content

Commit 1c1f353

Browse files
committed
fetch_populated_submodules(): document dynamic allocation
... while fixing a miscounting. Signed-off-by: Junio C Hamano <[email protected]>
1 parent c1a3c36 commit 1c1f353

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

submodule.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,8 @@ int fetch_populated_submodules(int num_options, const char **options,
264264
if (read_cache() < 0)
265265
die("index file corrupt");
266266

267-
argv = xcalloc(num_options + 5, sizeof(const char *));
267+
/* 4: "fetch" (options) "--submodule-prefix" prefix NULL */
268+
argv = xcalloc(num_options + 4, sizeof(const char *));
268269
argv[argc++] = "fetch";
269270
for (i = 0; i < num_options; i++)
270271
argv[argc++] = options[i];

0 commit comments

Comments
 (0)