aboutsummaryrefslogtreecommitdiffstats
path: root/noice.c
diff options
context:
space:
mode:
Diffstat (limited to 'noice.c')
-rw-r--r--noice.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/noice.c b/noice.c
index 5067424..d1b2c91 100644
--- a/noice.c
+++ b/noice.c
@@ -423,12 +423,12 @@ canopendir(char *path)
void
printent(struct entry *ent, int active)
{
- char *name;
+ char name[PATH_MAX];
unsigned int maxlen = COLS - strlen(CURSR) - 1;
char cm = 0;
/* Copy name locally */
- name = xstrdup(ent->name);
+ strlcpy(name, ent->name, sizeof(name));
if (S_ISDIR(ent->mode)) {
cm = '/';
@@ -455,8 +455,6 @@ printent(struct entry *ent, int active)
printw("%s%s\n", active ? CURSR : EMPTY, name);
else
printw("%s%s%c\n", active ? CURSR : EMPTY, name, cm);
-
- free(name);
}
int