Skip to content

Commit

Permalink
Merge branch 'as/calloc-takes-nmemb-then-size'
Browse files Browse the repository at this point in the history
Code clean-up.

* as/calloc-takes-nmemb-then-size:
  calloc() and xcalloc() takes nmemb and then size
  • Loading branch information
Junio C Hamano committed Sep 19, 2014
2 parents 70f003e + 693eb02 commit 14e2ae6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion builtin/for-each-ref.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
2 changes: 1 addition & 1 deletion imap-send.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 14e2ae6

Please sign in to comment.