commit e635760742df363f0a11ee1a6828908b62a7070d
parent d40333e702c5f116cbc0650b5dd5512abb17c5e4
Author: sin <sin@2f30.org>
Date: Wed, 18 Feb 2015 16:48:07 +0000
Fix ls when -q is not set
Use strdup() unconditionally.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ls.c b/ls.c
@@ -209,7 +209,7 @@ lsdir(const char *path)
output(&ent);
} else {
ents = erealloc(ents, ++n * sizeof(*ents));
- name = p = emalloc(strlen(d->d_name) + 1);
+ name = p = estrdup(d->d_name);
if (qflag) {
q = d->d_name;
while (*q) {