aboutsummaryrefslogtreecommitdiff
path: root/src/common/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/util.c')
-rw-r--r--src/common/util.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/common/util.c b/src/common/util.c
index 8bd1f2aec..264bd0b74 100644
--- a/src/common/util.c
+++ b/src/common/util.c
@@ -434,11 +434,20 @@ const char *
find_whitespace(const char *s)
{
/* tor_assert(s); */
-
- while (*s && !TOR_ISSPACE(*s) && *s != '#')
- s++;
-
- return s;
+ while (1) {
+ switch (*s)
+ {
+ case '\0':
+ case '#':
+ case ' ':
+ case '\r':
+ case '\n':
+ case '\t':
+ return s;
+ default:
+ ++s;
+ }
+ }
}
/** Return true iff the 'len' bytes at 'mem' are all zero. */