summaryrefslogtreecommitdiffstats
path: root/src/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/util.c b/src/util.c
index 0c1fd5e..7d590c5 100644
--- a/src/util.c
+++ b/src/util.c
@@ -552,13 +552,9 @@ lilv_dir_for_each(const char* path,
name_max = 255; // Limit not defined, or error
}
- const size_t len = offsetof(struct dirent, d_name) + name_max + 1;
- struct dirent* entry = (struct dirent*)malloc(len);
- struct dirent* result;
- while (!readdir_r(dir, entry, &result) && result) {
+ for (struct dirent* entry; (entry = readdir(dir));) {
f(path, entry->d_name, data);
}
- free(entry);
closedir(dir);
}
#endif