Skip to content

Commit

Permalink
fetch_populated_submodules(): document dynamic allocation
Browse files Browse the repository at this point in the history
... while fixing a miscounting.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Junio C Hamano committed Dec 10, 2010
1 parent c1a3c36 commit 1c1f353
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion submodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit 1c1f353

Please sign in to comment.