mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 08:43:19 -04:00
Don't calculate len too early.
This commit is contained in:
parent
32981eb31b
commit
6d0d40f668
1 changed files with 1 additions and 1 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue