summaryrefslogtreecommitdiff
path: root/main/php_scandir.c
diff options
context:
space:
mode:
Diffstat (limited to 'main/php_scandir.c')
-rw-r--r--main/php_scandir.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/main/php_scandir.c b/main/php_scandir.c
index 94f5ef899d..7fdb49b77a 100644
--- a/main/php_scandir.c
+++ b/main/php_scandir.c
@@ -57,8 +57,7 @@ PHPAPI int php_scandir(const char *dirname, struct dirent **namelist[], int (*se
struct dirent **vector = NULL;
int vector_size = 0;
int nfiles = 0;
- char entry[sizeof(struct dirent)+MAXPATHLEN];
- struct dirent *dp = (struct dirent *)&entry;
+ struct dirent *dp;
if (namelist == NULL) {
return -1;
@@ -68,7 +67,7 @@ PHPAPI int php_scandir(const char *dirname, struct dirent **namelist[], int (*se
return -1;
}
- while (!php_readdir_r(dirp, (struct dirent *)entry, &dp) && dp) {
+ while ((dp = readdir(dirp))) {
size_t dsize = 0;
struct dirent *newdp = NULL;