diff options
| author | Junio C Hamano <gitster@pobox.com> | 2014-07-21 12:35:39 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2014-07-21 12:35:39 -0700 |
| commit | 9ab08822556c49a7856dadd0e9a42f9ec2aaf850 (patch) | |
| tree | f52f20367d13f2078fe6199e230322c899b9308d /builtin/clean.c | |
| parent | 0eff86e4f440fedf26f02f4c3b1a3ead8bfbe6f8 (diff) | |
| parent | 5c0b13f85ab3a5326508b854768eb70c8829cda4 (diff) | |
| download | git-9ab08822556c49a7856dadd0e9a42f9ec2aaf850.tar.gz | |
Merge branch 'maint'
* maint:
use xmemdupz() to allocate copies of strings given by start and length
use xcalloc() to allocate zero-initialized memory
Diffstat (limited to 'builtin/clean.c')
| -rw-r--r-- | builtin/clean.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/builtin/clean.c b/builtin/clean.c index 27701d222c..1032563e5f 100644 --- a/builtin/clean.c +++ b/builtin/clean.c @@ -621,8 +621,7 @@ static int *list_and_choose(struct menu_opts *opts, struct menu_stuff *stuff) nr += chosen[i]; } - result = xmalloc(sizeof(int) * (nr + 1)); - memset(result, 0, sizeof(int) * (nr + 1)); + result = xcalloc(nr + 1, sizeof(int)); for (i = 0; i < stuff->nr && j < nr; i++) { if (chosen[i]) result[j++] = i; |
