diff options
Diffstat (limited to 'pathspec.c')
-rw-r--r-- | pathspec.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/pathspec.c b/pathspec.c index 8043099955..9304ee33d7 100644 --- a/pathspec.c +++ b/pathspec.c @@ -338,7 +338,7 @@ static void NORETURN unsupported_magic(const char *pattern, if (!(magic & m->bit)) continue; if (sb.len) - strbuf_addstr(&sb, " "); + strbuf_addch(&sb, ' '); if (short_magic & m->bit) strbuf_addf(&sb, "'%c'", m->mnemonic); else @@ -389,8 +389,7 @@ void parse_pathspec(struct pathspec *pathspec, if (!(flags & PATHSPEC_PREFER_CWD)) die("BUG: PATHSPEC_PREFER_CWD requires arguments"); - pathspec->items = item = xmalloc(sizeof(*item)); - memset(item, 0, sizeof(*item)); + pathspec->items = item = xcalloc(1, sizeof(*item)); item->match = prefix; item->original = prefix; item->nowildcard_len = item->len = strlen(prefix); |