From 4135af3207daa7e50bcdb6bea13a5a0bc8bb126e Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 12 Feb 2017 17:59:17 +0100 Subject: Remove use of deprecated readdir_r --- src/util.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src') 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 -- cgit v1.2.1