aboutsummaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-07-22 10:25:17 -0700
committerJunio C Hamano <gitster@pobox.com>2014-07-22 10:25:17 -0700
commitcfececfe1ff1554783030a6f08b431ad50263800 (patch)
tree8b034605baeeb0f2d867caa6e7270f604bce9247 /builtin
parent1fbc6e6e6062c14f21d0d826aaa3c154dba0f9e8 (diff)
parent92e25b6b5b66320e73ace921f3db816ef4243d1b (diff)
downloadgit-cfececfe1ff1554783030a6f08b431ad50263800.tar.gz
git-cfececfe1ff1554783030a6f08b431ad50263800.tar.xz
Merge branch 'bg/xcalloc-nmemb-then-size' into maint
* bg/xcalloc-nmemb-then-size: transport-helper.c: rearrange xcalloc arguments remote.c: rearrange xcalloc arguments reflog-walk.c: rearrange xcalloc arguments pack-revindex.c: rearrange xcalloc arguments notes.c: rearrange xcalloc arguments imap-send.c: rearrange xcalloc arguments http-push.c: rearrange xcalloc arguments diff.c: rearrange xcalloc arguments config.c: rearrange xcalloc arguments commit.c: rearrange xcalloc arguments builtin/remote.c: rearrange xcalloc arguments builtin/ls-remote.c: rearrange xcalloc arguments
Diffstat (limited to 'builtin')
-rw-r--r--builtin/ls-remote.c2
-rw-r--r--builtin/remote.c8
2 files changed, 5 insertions, 5 deletions
diff --git a/builtin/ls-remote.c b/builtin/ls-remote.c
index 3e9eefb09..b2a4b9299 100644
--- a/builtin/ls-remote.c
+++ b/builtin/ls-remote.c
@@ -92,7 +92,7 @@ int cmd_ls_remote(int argc, const char **argv, const char *prefix)
if (argv[i]) {
int j;
- pattern = xcalloc(sizeof(const char *), argc - i + 1);
+ pattern = xcalloc(argc - i + 1, sizeof(const char *));
for (j = i; j < argc; j++) {
int len = strlen(argv[j]);
char *p = xmalloc(len + 3);
diff --git a/builtin/remote.c b/builtin/remote.c
index 9b3e36898..c9102e8fe 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);