mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2025-01-31 01:04:03 -05:00
Replace deprecated readdir_r() with readdir()
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
This commit is contained in:
parent
c90822a5c3
commit
85f3ab758e
@ -266,7 +266,6 @@ void wpa_ctrl_close(struct wpa_ctrl *ctrl)
|
|||||||
void wpa_ctrl_cleanup(void)
|
void wpa_ctrl_cleanup(void)
|
||||||
{
|
{
|
||||||
DIR *dir;
|
DIR *dir;
|
||||||
struct dirent entry;
|
|
||||||
struct dirent *result;
|
struct dirent *result;
|
||||||
size_t dirnamelen;
|
size_t dirnamelen;
|
||||||
size_t maxcopy;
|
size_t maxcopy;
|
||||||
@ -284,8 +283,8 @@ void wpa_ctrl_cleanup(void)
|
|||||||
}
|
}
|
||||||
namep = pathname + dirnamelen;
|
namep = pathname + dirnamelen;
|
||||||
maxcopy = PATH_MAX - dirnamelen;
|
maxcopy = PATH_MAX - dirnamelen;
|
||||||
while (readdir_r(dir, &entry, &result) == 0 && result != NULL) {
|
while ((result = readdir(dir)) != NULL) {
|
||||||
if (os_strlcpy(namep, entry.d_name, maxcopy) < maxcopy)
|
if (os_strlcpy(namep, result->d_name, maxcopy) < maxcopy)
|
||||||
unlink(pathname);
|
unlink(pathname);
|
||||||
}
|
}
|
||||||
closedir(dir);
|
closedir(dir);
|
||||||
|
Loading…
Reference in New Issue
Block a user