Merge branch 'as/calloc-takes-nmemb-then-size'
authorJunio C Hamano <gitster@pobox.com>
Fri, 19 Sep 2014 18:38:37 +0000 (11:38 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 19 Sep 2014 18:38:37 +0000 (11:38 -0700)
Code clean-up.

* as/calloc-takes-nmemb-then-size:
calloc() and xcalloc() takes nmemb and then size

builtin/for-each-ref.c
imap-send.c
index 47bd624696d5e94295dda8846f00dcbb80a6ca5a..69bba067189776d8411b1926084b53659799d0da 100644 (file)
@@ -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];
index f33e56dba1e06cd61448069e3d300e3650477320..70bcc7a4e533bb04e8c515e8831a75ec93d2d066 100644 (file)
@@ -919,7 +919,7 @@ static struct imap_store *imap_open_store(struct imap_server_conf *srvc, char *f
 
        ctx = xcalloc(1, sizeof(*ctx));
 
-       ctx->imap = imap = xcalloc(sizeof(*imap), 1);
+       ctx->imap = imap = xcalloc(1, sizeof(*imap));
        imap->buf.sock.fd[0] = imap->buf.sock.fd[1] = -1;
        imap->in_progress_append = &imap->in_progress;