[hackers] [sbase] Fix ls when -q is not set || sin

From: <git_AT_suckless.org>
Date: Wed, 18 Feb 2015 17:49:13 +0100 (CET)

commit a579034d667f1196c664eeb5453dc2d677f90ae5
Author: sin <sin_AT_2f30.org>
Date: Wed Feb 18 16:48:07 2015 +0000

    Fix ls when -q is not set
    
    Use strdup() unconditionally.

diff --git a/ls.c b/ls.c
index 900d5f6..e036e57 100644
--- a/ls.c
+++ b/ls.c
_AT_@ -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) {
Received on Wed Feb 18 2015 - 17:49:13 CET

This archive was generated by hypermail 2.3.0 : Wed Feb 18 2015 - 18:00:19 CET