From ca56dadb4b65ccaeab809d80db80a312dc00941a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Scharfe?= Date: Sat, 13 Mar 2021 17:17:22 +0100 Subject: use CALLOC_ARRAY MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add and apply a semantic patch for converting code that open-codes CALLOC_ARRAY to use it instead. It shortens the code and infers the element size automatically. Signed-off-by: René Scharfe Signed-off-by: Junio C Hamano --- imap-send.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'imap-send.c') diff --git a/imap-send.c b/imap-send.c index d0b94f911e..bb085d66d1 100644 --- a/imap-send.c +++ b/imap-send.c @@ -963,9 +963,9 @@ static struct imap_store *imap_open_store(struct imap_server_conf *srvc, const c char *arg, *rsp; int s = -1, preauth; - ctx = xcalloc(1, sizeof(*ctx)); + CALLOC_ARRAY(ctx, 1); - ctx->imap = imap = xcalloc(1, sizeof(*imap)); + ctx->imap = CALLOC_ARRAY(imap, 1); imap->buf.sock.fd[0] = imap->buf.sock.fd[1] = -1; imap->in_progress_append = &imap->in_progress; -- cgit v1.2.3