aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--noice.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/noice.c b/noice.c
index 8d6f0d7..66d856b 100644
--- a/noice.c
+++ b/noice.c
@@ -234,6 +234,7 @@ begin:
if (strcmp(dp->d_name, ".") == 0
|| strcmp(dp->d_name, "..") == 0)
continue;
+ /* Deep copy because readdir(3) reuses the entries */
dents = realloc(dents, (n + 1) * sizeof(*dents));
if (dents == NULL)
printerr(1, "realloc");