]> git.ipfire.org Git - thirdparty/git.git/commit - ref-filter.c
fix xcalloc() argument order
authorRené Scharfe <l.s.r@web.de>
Sat, 6 Mar 2021 11:26:19 +0000 (12:26 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 8 Mar 2021 17:45:04 +0000 (09:45 -0800)
commit241b5d3ebeea21b70a74fdc8c74e73f7ed829cb1
tree2912c1f5896fb1356a4ba09fa48129e1a5dd310f
parent59ec22464f6c2b170b05f287e00740ea2288fe5c
fix xcalloc() argument order

Pass the number of elements first and ther size second, as expected
by xcalloc().  Provide a semantic patch, which was actually used to
generate the rest of this patch.

The semantic patch would generate flip-flop diffs if both arguments
are sizeofs.  We don't have such a case, and it's hard to imagine
the usefulness of such an allocation.  If it ever occurs then we
could deal with it by duplicating the rule in the semantic patch to
make it cancel itself out, or we could change the code to use
CALLOC_ARRAY.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
add-interactive.c
blame.c
contrib/coccinelle/xcalloc.cocci [new file with mode: 0644]
range-diff.c
ref-filter.c
trailer.c