pack-revindex.c: rearrange xcalloc arguments
authorBrian Gesiak <modocache@gmail.com>
Mon, 26 May 2014 15:33:53 +0000 (00:33 +0900)
committerJunio C Hamano <gitster@pobox.com>
Tue, 27 May 2014 21:02:45 +0000 (14:02 -0700)
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>
pack-revindex.c
index 5bd7c619803c8457a8c1a1a69a11758d34b49eac..5c8376e9789301b921188e3bf19fba85960a7967 100644 (file)
@@ -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;