diff --git a/builtin-clean.c b/builtin-clean.c
index 6cad8eaf2591c8f7f04c78f5a2162808ae702e25..eb853a37cf993a875f2acd1992ee5191783740a1 100644 (file)
--- a/builtin-clean.c
+++ b/builtin-clean.c
strbuf_init(&directory, 0);
if (pathspec)
- seen = xmalloc(argc);
+ seen = xmalloc(argc > 0 ? argc : 1);
for (i = 0; i < dir.nr; i++) {
struct dir_entry *ent = dir.entries[i];
continue;
if (pathspec) {
- memset(seen, 0, argc);
+ memset(seen, 0, argc > 0 ? argc : 1);
matches = match_pathspec(pathspec, ent->name, ent->len,
baselen, seen);
} else {