]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'sg/xcalloc-cocci-fix'
authorJunio C Hamano <gitster@pobox.com>
Mon, 29 Aug 2022 21:55:14 +0000 (14:55 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 29 Aug 2022 21:55:14 +0000 (14:55 -0700)
xcalloc(), imitating calloc(), takes "number of elements of the
array", and "size of a single element", in this order.  A call that
does not follow this ordering has been corrected.

* sg/xcalloc-cocci-fix:
  promisor-remote: fix xcalloc() argument order

promisor-remote.c

index 5b33f88bca17a29921d459663115ec9bc683c8a1..68f46f5ec70b93b28fa7c75988d671a4046e8fee 100644 (file)
@@ -146,7 +146,7 @@ static void promisor_remote_init(struct repository *r)
        if (r->promisor_remote_config)
                return;
        config = r->promisor_remote_config =
-               xcalloc(sizeof(*r->promisor_remote_config), 1);
+               xcalloc(1, sizeof(*r->promisor_remote_config));
        config->promisors_tail = &config->promisors;
 
        repo_config(r, promisor_remote_config, config);