diff options
author | Nick Mathewson <nickm@torproject.org> | 2005-11-15 03:16:32 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2005-11-15 03:16:32 +0000 |
commit | 6c361468c11d3342cc0e774cf4d10ac40819771a (patch) | |
tree | ecc4f17c54f6a29e218136c8c91098b3641a007f /src/common/util.c | |
parent | 9b432311c4d692d68f913027a95e050b1067c5d9 (diff) | |
download | tor-6c361468c11d3342cc0e774cf4d10ac40819771a.tar.gz tor-6c361468c11d3342cc0e774cf4d10ac40819771a.zip |
Loops without an increment step can suck, even on windows.
svn:r5376
Diffstat (limited to 'src/common/util.c')
-rw-r--r-- | src/common/util.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/common/util.c b/src/common/util.c index 2d43f18600..8b010bd320 100644 --- a/src/common/util.c +++ b/src/common/util.c @@ -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."); |