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 <arjun024@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Arjun Sreedharan committed
Aug 30, 2014 at 12:24 UTC
693eb02a5e152668dacc7c6ff0f1c63d70c0a82a
2 files changed
+2
-2
builtin/for-each-ref.c
+1
-1
@@ -633,7 +633,7 @@ static void populate_value(struct refinfo *ref)
633
unsigned long size;
634
const unsigned char *tagged;
635
636
- ref->value = xcalloc(sizeof(struct atom_value), used_atom_cnt);
636
+ ref->value = xcalloc(used_atom_cnt, sizeof(struct atom_value));
637
638
if (need_symref && (ref->flag & REF_ISSYMREF) && !ref->symref) {
639
unsigned char unused1[20];
imap-send.c
+1
-1
@@ -954,7 +954,7 @@ static struct imap_store *imap_open_store(struct imap_server_conf *srvc)
954
955
ctx = xcalloc(1, sizeof(*ctx));
956
957
- ctx->imap = imap = xcalloc(sizeof(*imap), 1);
957
+ ctx->imap = imap = xcalloc(1, sizeof(*imap));
958
imap->buf.sock.fd[0] = imap->buf.sock.fd[1] = -1;
959
imap->in_progress_append = &imap->in_progress;
960