diff options
author | Junio C Hamano <gitster@pobox.com> | 2015-08-26 15:45:33 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-08-26 15:45:34 -0700 |
commit | 88bd19be2fa4ae3343e89b73c103c3c51fe3044f (patch) | |
tree | 5384e94b4e7c93fd7304db7cc1d482006faf0f5e | |
parent | Merge branch 'dt/untracked-sparse' (diff) | |
parent | ps_matched: xcalloc() takes nmemb and then element size (diff) | |
download | tgif-88bd19be2fa4ae3343e89b73c103c3c51fe3044f.tar.xz |
Merge branch 'jc/calloc-pathspec'
* jc/calloc-pathspec:
ps_matched: xcalloc() takes nmemb and then element size
-rw-r--r-- | builtin/checkout.c | 2 | ||||
-rw-r--r-- | builtin/ls-files.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/builtin/checkout.c b/builtin/checkout.c index e1403bec27..52d59eba80 100644 --- a/builtin/checkout.c +++ b/builtin/checkout.c @@ -280,7 +280,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 6fa2205734..b6a7cb0c7c 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"); |