Skip to content
Snippets Groups Projects
Commit 6c361468 authored by Nick Mathewson's avatar Nick Mathewson :game_die:
Browse files

Loops without an increment step can suck, even on windows.

svn:r5376
parent 9b432311
Branches
Tags
No related merge requests found
......@@ -1243,10 +1243,10 @@ tor_listdir(const char *dirname)
}
result = smartlist_create();
while (1) {
if (!strcmp(findData.cFileName, ".") ||
!strcmp(findData.cFileName, ".."))
continue;
smartlist_add(result, tor_strdup(findData.cFileName));
if (strcmp(findData.cFileName, ".") &&
strcmp(findData.cFileName, "..")) {
smartlist_add(result, tor_strdup(findData.cFileName));
}
if (!FindNextFile(handle, &findData)) {
if (GetLastError() != ERROR_NO_MORE_FILES) {
warn(LD_FS, "Error reading directory.");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment