summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2017-02-12 17:59:17 +0100
committerDavid Robillard <d@drobilla.net>2017-02-12 17:59:17 +0100
commit4135af3207daa7e50bcdb6bea13a5a0bc8bb126e (patch)
tree82e7b42b94d616110fe63b84049d77e2d55c4ba4 /src
parentd2de1ed3abdbbf146c13001c2bc932a2dc52e615 (diff)
downloadlilv-4135af3207daa7e50bcdb6bea13a5a0bc8bb126e.tar.gz
lilv-4135af3207daa7e50bcdb6bea13a5a0bc8bb126e.tar.bz2
lilv-4135af3207daa7e50bcdb6bea13a5a0bc8bb126e.zip
Remove use of deprecated readdir_r
Diffstat (limited to 'src')
-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