All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arjun Sreedharan <arjun024@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: [PATCH] fix calloc() and xcalloc() argument ordering
Date: Thu,  4 Sep 2014 19:33:15 +0530	[thread overview]
Message-ID: <1409839395-1902-1-git-send-email-arjun024@gmail.com> (raw)
In-Reply-To: <xmqqegvt27ac.fsf@gitster.dls.corp.google.com>

@number first, @size second argument.

Signed-off-by: Arjun Sreedharan <arjun024@gmail.com>
---
 builtin/for-each-ref.c | 2 +-
 imap-send.c            | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/builtin/for-each-ref.c b/builtin/for-each-ref.c
index 47bd624..69bba06 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];
diff --git a/imap-send.c b/imap-send.c
index 524fbab..02eb3e0 100644
--- a/imap-send.c
+++ b/imap-send.c
@@ -954,7 +954,7 @@ static struct imap_store *imap_open_store(struct imap_server_conf *srvc)
 
 	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;
 
-- 
1.8.1.msysgit.1

      parent reply	other threads:[~2014-09-04 14:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-30  6:54 [PATCH] fix calloc() and xcalloc() argument ordering Arjun Sreedharan
2014-09-02 18:42 ` Junio C Hamano
2014-09-03  6:30   ` Arjun Sreedharan
2014-09-04 14:03   ` Arjun Sreedharan [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1409839395-1902-1-git-send-email-arjun024@gmail.com \
    --to=arjun024@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.