summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-09-04 02:18:00 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-09-04 02:18:00 (GMT)
commitae6ac8483b706b48882dcee96a42a4198744308a (patch)
treefd9ce9fbce475de9411ad3c5f313e68a4785d0f0 /builtin
parent8136099a318a3c2c8883fba8dd3f570fc332ead6 (diff)
parent8b54c23437834b36bbb5f6de2f577400385da770 (diff)
downloadgit-ae6ac8483b706b48882dcee96a42a4198744308a.zip
git-ae6ac8483b706b48882dcee96a42a4198744308a.tar.gz
git-ae6ac8483b706b48882dcee96a42a4198744308a.tar.bz2
Merge branch 'jc/calloc-pathspec' into maint
Minor code cleanup. * jc/calloc-pathspec: ps_matched: xcalloc() takes nmemb and then element size
Diffstat (limited to 'builtin')
-rw-r--r--builtin/checkout.c2
-rw-r--r--builtin/ls-files.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/builtin/checkout.c b/builtin/checkout.c
index f71844a..3b6e499 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -282,7 +282,7 @@ static int checkout_paths(const struct checkout_opts *opts,
if (opts->source_tree)
read_tree_some(opts->source_tree, &opts->pathspec);
- ps_matched = xcalloc(1, opts->pathspec.nr);
+ ps_matched = xcalloc(opts->pathspec.nr, 1);
/*
* Make sure all pathspecs participated in locating the paths
diff --git a/builtin/ls-files.c b/builtin/ls-files.c
index 6fa2205..b6a7cb0 100644
--- a/builtin/ls-files.c
+++ b/builtin/ls-files.c
@@ -516,7 +516,7 @@ int cmd_ls_files(int argc, const char **argv, const char *cmd_prefix)
/* Treat unmatching pathspec elements as errors */
if (pathspec.nr && error_unmatch)
- ps_matched = xcalloc(1, pathspec.nr);
+ ps_matched = xcalloc(pathspec.nr, 1);
if ((dir.flags & DIR_SHOW_IGNORED) && !exc_given)
die("ls-files --ignored needs some exclude pattern");