aboutsummaryrefslogtreecommitdiff
path: root/diff-delta.c
diff options
context:
space:
mode:
authorToon Claes <toon@iotcl.com>2025-12-10 14:13:01 +0100
committerJunio C Hamano <gitster@pobox.com>2025-12-11 14:44:43 +0900
commita67b902c94a2f33275a3947a8bcdab03f64ae75e (patch)
treec5e00364a71a55934e1d2c13abf31a7474e5478d /diff-delta.c
parentaf0ed97e1031f2709dbd4fc4f40c4ded711acd49 (diff)
downloadgit-a67b902c94a2f33275a3947a8bcdab03f64ae75e.tar.xz
git-compat-util: introduce MEMZERO_ARRAY() macro
Introduce a new macro MEMZERO_ARRAY() that zeroes the memory allocated by ALLOC_ARRAY() and friends. And add coccinelle rule to enforce the use of this macro. Signed-off-by: Toon Claes <toon@iotcl.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'diff-delta.c')
-rw-r--r--diff-delta.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/diff-delta.c b/diff-delta.c
index 71d37368d6..43c339f010 100644
--- a/diff-delta.c
+++ b/diff-delta.c
@@ -171,7 +171,7 @@ struct delta_index * create_delta_index(const void *buf, unsigned long bufsize)
mem = hash + hsize;
entry = mem;
- memset(hash, 0, hsize * sizeof(*hash));
+ MEMZERO_ARRAY(hash, hsize);
/* allocate an array to count hash entries */
hash_count = calloc(hsize, sizeof(*hash_count));