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 --- negotiator/default.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'negotiator/default.c') diff --git a/negotiator/default.c b/negotiator/default.c index 4b78f6bf36..434189ae5d 100644 --- a/negotiator/default.c +++ b/negotiator/default.c @@ -167,7 +167,7 @@ void default_negotiator_init(struct fetch_negotiator *negotiator) negotiator->next = next; negotiator->ack = ack; negotiator->release = release; - negotiator->data = ns = xcalloc(1, sizeof(*ns)); + negotiator->data = CALLOC_ARRAY(ns, 1); ns->rev_list.compare = compare_commits_by_commit_date; if (marked) -- cgit v1.2.3