From ca56dadb4b65ccaeab809d80db80a312dc00941a Mon Sep 17 00:00:00 2001 From: René Scharfe 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 --- notes-utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'notes-utils.c') diff --git a/notes-utils.c b/notes-utils.c index 4bf4888d8c..d7d18e30f5 100644 --- a/notes-utils.c +++ b/notes-utils.c @@ -129,7 +129,7 @@ struct notes_rewrite_cfg *init_copy_notes_for_rewrite(const char *cmd) c->cmd = cmd; c->enabled = 1; c->combine = combine_notes_concatenate; - c->refs = xcalloc(1, sizeof(struct string_list)); + CALLOC_ARRAY(c->refs, 1); c->refs->strdup_strings = 1; c->refs_from_env = 0; c->mode_from_env = 0; -- cgit v1.2.3