Re: [PATCH 1/2] git-compat-util: introduce MEMZERO_ARRAY() macro
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Dec 11, 2025, 03:18 UTC
- Message-ID
- <xmqqtsxxg0z4.fsf@gitster.g>
- In-Reply-To
- <20251210-toon-cocci-memzero-v1-1-ae916a79065b@iotcl.com>
Toon Claes <toon@iotcl.com> writes:
Show 5 quoted lines
> +@@ > +- memset(ptr, \( 0x0 \| 0 \), n * \( sizeof(T) > +- \| sizeof(*ptr) > +- \) ) > ++ MEMZERO_ARRAY(ptr, n)
Shouldn't we be also catching
memset(array, '\0', sizeof(array[0]) * ARRAY_SIZE(array));
in addition to "0" and "0x0"?