Thread (27 messages) flat view 27 messages, 4 authors, 2016-06-15
STALE3736d

[PATCH 12/15] pack-revindex.c: rearrange xcalloc arguments

From: Brian Gesiak <hidden>
Date: 2016-06-15 23:01:22
Subsystem: the rest · Maintainer: Linus Torvalds

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.
Rearrgange them so they are in the correct order.

Signed-off-by: Brian Gesiak <redacted>
---
 pack-revindex.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pack-revindex.c b/pack-revindex.c
index b4d2b35..f84979b 100644
--- a/pack-revindex.c
+++ b/pack-revindex.c
@@ -50,7 +50,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;
-- 
2.0.0.rc1.543.gc8042da
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help