summaryrefslogtreecommitdiff
path: root/trailer.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2021-03-19 22:25:39 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-03-19 22:25:39 (GMT)
commitbfcc6e2a68b95ee71fc606a2e3917af78f1130f9 (patch)
tree30a225e537754d8b2579304d9872b0374be18c73 /trailer.c
parentaf107029b1b10f56b7e8b35ea605eab54f4efbe2 (diff)
parent241b5d3ebeea21b70a74fdc8c74e73f7ed829cb1 (diff)
downloadgit-bfcc6e2a68b95ee71fc606a2e3917af78f1130f9.zip
git-bfcc6e2a68b95ee71fc606a2e3917af78f1130f9.tar.gz
git-bfcc6e2a68b95ee71fc606a2e3917af78f1130f9.tar.bz2
Merge branch 'rs/xcalloc-takes-nelem-first'
Code cleanup. * rs/xcalloc-takes-nelem-first: fix xcalloc() argument order
Diffstat (limited to 'trailer.c')
-rw-r--r--trailer.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/trailer.c b/trailer.c
index 5308165..be4e972 100644
--- a/trailer.c
+++ b/trailer.c
@@ -174,7 +174,7 @@ static void print_all(FILE *outfile, struct list_head *head,
static struct trailer_item *trailer_from_arg(struct arg_item *arg_tok)
{
- struct trailer_item *new_item = xcalloc(sizeof(*new_item), 1);
+ struct trailer_item *new_item = xcalloc(1, sizeof(*new_item));
new_item->token = arg_tok->token;
new_item->value = arg_tok->value;
arg_tok->token = arg_tok->value = NULL;
@@ -664,7 +664,7 @@ static void parse_trailer(struct strbuf *tok, struct strbuf *val,
static struct trailer_item *add_trailer_item(struct list_head *head, char *tok,
char *val)
{
- struct trailer_item *new_item = xcalloc(sizeof(*new_item), 1);
+ struct trailer_item *new_item = xcalloc(1, sizeof(*new_item));
new_item->token = tok;
new_item->value = val;
list_add_tail(&new_item->list, head);
@@ -675,7 +675,7 @@ static void add_arg_item(struct list_head *arg_head, char *tok, char *val,
const struct conf_info *conf,
const struct new_trailer_item *new_trailer_item)
{
- struct arg_item *new_item = xcalloc(sizeof(*new_item), 1);
+ struct arg_item *new_item = xcalloc(1, sizeof(*new_item));
new_item->token = tok;
new_item->value = val;
duplicate_conf(&new_item->conf, conf);