builtin/remote.c: rearrange xcalloc arguments

xcalloc() takes two arguments: the number of elements and their size. builtin/remote.c includes several calls to xcalloc() that pass the arguments in reverse order. Rearrange them so they are in the correct order. Signed-off-by: Brian Gesiak <modocache@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Brian Gesiak committed May 27, 2014 at 00:33 UTC 380694544d3e5e882c0f62be372c666911c405b2
1 file changed +4 -4
builtin/remote.c
+4 -4
@@ -282,7 +282,7 @@ static int config_read_branches(const char *key, const char *value, void *cb)
282 item = string_list_insert(&branch_list, name);
283
284 if (!item->util)
285 - item->util = xcalloc(sizeof(struct branch_info), 1);
285 + item->util = xcalloc(1, sizeof(struct branch_info));
286 info = item->util;
287 if (type == REMOTE) {
288 if (info->remote_name)
@@ -398,7 +398,7 @@ static int get_push_ref_states(const struct ref *remote_refs,
398
399 item = string_list_append(&states->push,
400 abbrev_branch(ref->peer_ref->name));
401 - item->util = xcalloc(sizeof(struct push_info), 1);
401 + item->util = xcalloc(1, sizeof(struct push_info));
402 info = item->util;
403 info->forced = ref->force;
404 info->dest = xstrdup(abbrev_branch(ref->name));
@@ -433,7 +433,7 @@ static int get_push_ref_states_noquery(struct ref_states *states)
433 states->push.strdup_strings = 1;
434 if (!remote->push_refspec_nr) {
435 item = string_list_append(&states->push, _("(matching)"));
436 - info = item->util = xcalloc(sizeof(struct push_info), 1);
436 + info = item->util = xcalloc(1, sizeof(struct push_info));
437 info->status = PUSH_STATUS_NOTQUERIED;
438 info->dest = xstrdup(item->string);
439 }
@@ -446,7 +446,7 @@ static int get_push_ref_states_noquery(struct ref_states *states)
446 else
447 item = string_list_append(&states->push, _("(delete)"));
448
449 - info = item->util = xcalloc(sizeof(struct push_info), 1);
449 + info = item->util = xcalloc(1, sizeof(struct push_info));
450 info->forced = spec->force;
451 info->status = PUSH_STATUS_NOTQUERIED;
452 info->dest = xstrdup(spec->dst ? spec->dst : item->string);