diff options
Diffstat (limited to 'main/php_scandir.c')
-rw-r--r-- | main/php_scandir.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/main/php_scandir.c b/main/php_scandir.c index 94d4b28b2c..76628528a4 100644 --- a/main/php_scandir.c +++ b/main/php_scandir.c @@ -17,8 +17,6 @@ +----------------------------------------------------------------------+ */ -/* $Id$ */ - #include "php.h" #include "php_scandir.h" @@ -73,7 +71,7 @@ PHPAPI int php_scandir(const char *dirname, struct dirent **namelist[], int (*se } while (!php_readdir_r(dirp, (struct dirent *)entry, &dp) && dp) { - int dsize = 0; + size_t dsize = 0; struct dirent *newdp = NULL; if (selector && (*selector)(dp) == 0) { @@ -95,7 +93,7 @@ PHPAPI int php_scandir(const char *dirname, struct dirent **namelist[], int (*se vector = newv; } - dsize = sizeof (struct dirent) + (((int)strlen(dp->d_name) + 1) * sizeof(char)); + dsize = sizeof (struct dirent) + ((strlen(dp->d_name) + 1) * sizeof(char)); newdp = (struct dirent *) malloc(dsize); if (newdp == NULL) { |