Pārlūkot izejas kodu

Comment on dirents deep copy

master
lostd pirms 11 gadiem
vecāks
revīzija
368b43572d
1 mainītis faili ar 1 papildinājumiem un 0 dzēšanām
  1. +1
    -0
      noice.c

+ 1
- 0
noice.c Parādīt failu

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


Notiek ielāde…
Atcelt
Saglabāt