2002-04-17 Ralf Corsepius <corsepiu@faw.uni-ulm.de>

* libc/scandir.c: Initialize nitems = 0.
This commit is contained in:
Joel Sherrill
2002-04-17 14:01:34 +00:00
parent cf80584ec6
commit 1216c9cebf
4 changed files with 7 additions and 6 deletions

View File

@@ -86,7 +86,7 @@ scandir(dirname, namelist, select, dcomp)
register struct dirent *d = NULL;
register struct dirent *p = NULL;
register struct dirent **names = NULL;
register size_t nitems;
register size_t nitems = 0;
struct stat stb;
long arraysz;
DIR *dirp = NULL;
@@ -106,7 +106,6 @@ scandir(dirname, namelist, select, dcomp)
if (names == NULL)
goto cleanup_and_bail;
nitems = 0;
while ((d = readdir(dirp)) != NULL) {
if (select != NULL && !(*select)(d))
continue; /* just selected names */

View File

@@ -1,3 +1,7 @@
2002-04-17 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
* libc/scandir.c: Initialize nitems = 0.
2002-04-16 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
* include/Makefile.am: Add stdint.h and inttypes.h.

View File

@@ -86,7 +86,7 @@ scandir(dirname, namelist, select, dcomp)
register struct dirent *d = NULL;
register struct dirent *p = NULL;
register struct dirent **names = NULL;
register size_t nitems;
register size_t nitems = 0;
struct stat stb;
long arraysz;
DIR *dirp = NULL;
@@ -106,7 +106,6 @@ scandir(dirname, namelist, select, dcomp)
if (names == NULL)
goto cleanup_and_bail;
nitems = 0;
while ((d = readdir(dirp)) != NULL) {
if (select != NULL && !(*select)(d))
continue; /* just selected names */