summaryrefslogtreecommitdiff
path: root/server-info.c
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2021-03-13 17:17:22 +0100
committerJunio C Hamano <gitster@pobox.com>2021-03-13 16:00:09 -0800
commitca56dadb4b65ccaeab809d80db80a312dc00941a (patch)
treefa027eb80d076ebf7be7c3ea69a92cf47e594a1c /server-info.c
parentf1121499e6460e814ec3cffa0b18942ac529f768 (diff)
downloadgit-ca56dadb4b65ccaeab809d80db80a312dc00941a.tar.gz
use CALLOC_ARRAY
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 <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'server-info.c')
-rw-r--r--server-info.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/server-info.c b/server-info.c
index bae2cdfd51..de0aa4498c 100644
--- a/server-info.c
+++ b/server-info.c
@@ -296,7 +296,7 @@ static void init_pack_info(const char *infofile, int force)
i = num_pack++;
ALLOC_GROW(info, num_pack, alloc);
- info[i] = xcalloc(1, sizeof(struct pack_info));
+ CALLOC_ARRAY(info[i], 1);
info[i]->p = p;
info[i]->old_num = -1;
}