1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-28 17:26:12 +02:00

Merge branch 'jc/calloc-pathspec' into maint

Minor code cleanup.

* jc/calloc-pathspec:
  ps_matched: xcalloc() takes nmemb and then element size
This commit is contained in:
Junio C Hamano 2015-09-03 19:18:00 -07:00
commit ae6ac8483b
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -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");