From 693eb02a5e152668dacc7c6ff0f1c63d70c0a82a Mon Sep 17 00:00:00 2001 From: Arjun Sreedharan Date: Sat, 30 Aug 2014 12:24:23 +0530 Subject: calloc() and xcalloc() takes nmemb and then size There are a handful more instances of this in compat/regex/ but they are borrowed code taht we do not want to touch with a change that really affects correctness, which this change is not. Signed-off-by: Arjun Sreedharan Signed-off-by: Junio C Hamano --- builtin/for-each-ref.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'builtin') diff --git a/builtin/for-each-ref.c b/builtin/for-each-ref.c index 47bd624696..69bba06718 100644 --- a/builtin/for-each-ref.c +++ b/builtin/for-each-ref.c @@ -633,7 +633,7 @@ static void populate_value(struct refinfo *ref) unsigned long size; const unsigned char *tagged; - ref->value = xcalloc(sizeof(struct atom_value), used_atom_cnt); + ref->value = xcalloc(used_atom_cnt, sizeof(struct atom_value)); if (need_symref && (ref->flag & REF_ISSYMREF) && !ref->symref) { unsigned char unused1[20]; -- cgit v1.2.3