mirror of
https://github.com/jarun/nnn.git
synced 2024-11-24 20:01:27 +00:00
Comment on dirents deep copy
This commit is contained in:
parent
973aff99b7
commit
368b43572d
1
noice.c
1
noice.c
|
@ -234,6 +234,7 @@ begin:
|
||||||
if (strcmp(dp->d_name, ".") == 0
|
if (strcmp(dp->d_name, ".") == 0
|
||||||
|| strcmp(dp->d_name, "..") == 0)
|
|| strcmp(dp->d_name, "..") == 0)
|
||||||
continue;
|
continue;
|
||||||
|
/* Deep copy because readdir(3) reuses the entries */
|
||||||
dents = realloc(dents, (n + 1) * sizeof(*dents));
|
dents = realloc(dents, (n + 1) * sizeof(*dents));
|
||||||
if (dents == NULL)
|
if (dents == NULL)
|
||||||
printerr(1, "realloc");
|
printerr(1, "realloc");
|
||||||
|
|
Loading…
Reference in a new issue