Skip to content

Commit

Permalink
pack-revindex.c: rearrange xcalloc arguments
Browse files Browse the repository at this point in the history
xcalloc() takes two arguments: the number of elements and their size.
init_pack_revindex() passes the arguments in reverse order, passing the
size of a pack_revindex, followed by the number to allocate.

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>
  • Loading branch information
Brian Gesiak authored and Junio C Hamano committed May 27, 2014
1 parent 65bbf08 commit 48d547f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pack-revindex.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ static void init_pack_revindex(void)
if (!num)
return;
pack_revindex_hashsz = num * 11;
pack_revindex = xcalloc(sizeof(*pack_revindex), pack_revindex_hashsz);
pack_revindex = xcalloc(pack_revindex_hashsz, sizeof(*pack_revindex));
for (p = packed_git; p; p = p->next) {
num = pack_revindex_ix(p);
num = - 1 - num;
Expand Down

0 comments on commit 48d547f

Please sign in to comment.