diff options
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/gen/directory.3 | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libc/gen/directory.3 b/lib/libc/gen/directory.3 index e6d8798..992d2fc 100644 --- a/lib/libc/gen/directory.3 +++ b/lib/libc/gen/directory.3 @@ -207,10 +207,10 @@ see .Pp Sample code which searches a directory for entry ``name'' is: .Bd -literal -offset indent -len = strlen(name); dirp = opendir("."); if (dirp == NULL) return (ERROR); +len = strlen(name); while ((dp = readdir(dirp)) != NULL) { if (dp->d_namlen == len && strcmp(dp->d_name, name) == 0) { (void)closedir(dirp); |