diff options
author | Brian Gesiak <modocache@gmail.com> | 2014-05-27 00:33:44 +0900 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-05-27 14:00:43 -0700 |
commit | 380694544d3e5e882c0f62be372c666911c405b2 (patch) | |
tree | eef4b1be0217c2042f46ceeabb114637139dcb1a /builtin | |
parent | edd2d8466523094c9b14762e402b0de15d68fec0 (diff) | |
download | git-380694544d3e5e882c0f62be372c666911c405b2.tar.gz git-380694544d3e5e882c0f62be372c666911c405b2.tar.xz |
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>
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/remote.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/builtin/remote.c b/builtin/remote.c index b3ab4cf8f..9f6202167 100644 --- a/builtin/remote.c +++ b/builtin/remote.c @@ -282,7 +282,7 @@ static int config_read_branches(const char *key, const char *value, void *cb) item = string_list_insert(&branch_list, name); if (!item->util) - item->util = xcalloc(sizeof(struct branch_info), 1); + item->util = xcalloc(1, sizeof(struct branch_info)); info = item->util; if (type == REMOTE) { if (info->remote_name) @@ -398,7 +398,7 @@ static int get_push_ref_states(const struct ref *remote_refs, item = string_list_append(&states->push, abbrev_branch(ref->peer_ref->name)); - item->util = xcalloc(sizeof(struct push_info), 1); + item->util = xcalloc(1, sizeof(struct push_info)); info = item->util; info->forced = ref->force; info->dest = xstrdup(abbrev_branch(ref->name)); @@ -433,7 +433,7 @@ static int get_push_ref_states_noquery(struct ref_states *states) states->push.strdup_strings = 1; if (!remote->push_refspec_nr) { item = string_list_append(&states->push, _("(matching)")); - info = item->util = xcalloc(sizeof(struct push_info), 1); + info = item->util = xcalloc(1, sizeof(struct push_info)); info->status = PUSH_STATUS_NOTQUERIED; info->dest = xstrdup(item->string); } @@ -446,7 +446,7 @@ static int get_push_ref_states_noquery(struct ref_states *states) else item = string_list_append(&states->push, _("(delete)")); - info = item->util = xcalloc(sizeof(struct push_info), 1); + info = item->util = xcalloc(1, sizeof(struct push_info)); info->forced = spec->force; info->status = PUSH_STATUS_NOTQUERIED; info->dest = xstrdup(spec->dst ? spec->dst : item->string); |