Comment on dirents deep copy

This commit is contained in:
lostd 2014-10-08 22:55:44 +03:00
parent 973aff99b7
commit 368b43572d
1 changed files with 1 additions and 0 deletions

View File

@ -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");