promisor-remote: fix xcalloc() argument order

Pass the number of elements first and their size second, as expected by xcalloc(). Patch generated with: make SPATCH_FLAGS=--recursive-includes contrib/coccinelle/xcalloc.cocci.patch Our default SPATCH_FLAGS ('--all-includes') doesn't catch this transformation by default, unless used in combination with a large-ish SPATCH_BATCH_SIZE which happens to put 'promisor-remote.c' with a file that includes 'repository.h' directly in the same batch. Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

SZEDER Gábor committed Aug 23, 2022 at 11:57 UTC c4bbd9bb8fd307c3c8be16121391416a5685ffe1
1 file changed +1 -1
promisor-remote.c
+1 -1
@@ -146,7 +146,7 @@ static void promisor_remote_init(struct repository *r)
146 if (r->promisor_remote_config)
147 return;
148 config = r->promisor_remote_config =
149 - xcalloc(sizeof(*r->promisor_remote_config), 1);
149 + xcalloc(1, sizeof(*r->promisor_remote_config));
150 config->promisors_tail = &config->promisors;
151
152 repo_config(r, promisor_remote_config, config);