diff options
author | Brian Gesiak <modocache@gmail.com> | 2014-05-27 00:33:45 +0900 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-05-27 14:00:43 -0700 |
commit | c4a7b0092bbe39a6b05ddd65a6b3e45565203367 (patch) | |
tree | e5a1d5c16930ccc0bddd8ba73b14589971f44de6 /commit.c | |
parent | 380694544d3e5e882c0f62be372c666911c405b2 (diff) | |
download | git-c4a7b0092bbe39a6b05ddd65a6b3e45565203367.tar.gz |
commit.c: rearrange xcalloc arguments
xcalloc() takes two arguments: the number of elements and their size.
reduce_heads() passes the arguments in reverse order, passing the
size of a commit*, followed by the number of commit* to be allocated.
Rearrange them so they are in the correct order.
Signed-off-by: Brian Gesiak <modocache@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit.c')
-rw-r--r-- | commit.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1031,7 +1031,7 @@ struct commit_list *reduce_heads(struct commit_list *heads) p->item->object.flags |= STALE; num_head++; } - array = xcalloc(sizeof(*array), num_head); + array = xcalloc(num_head, sizeof(*array)); for (p = heads, i = 0; p; p = p->next) { if (p->item->object.flags & STALE) { array[i++] = p->item; |