diff options
Diffstat (limited to 'src/common/util.c')
-rw-r--r-- | src/common/util.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/common/util.c b/src/common/util.c index a7bce2ea6c..9024dbfe10 100644 --- a/src/common/util.c +++ b/src/common/util.c @@ -712,6 +712,19 @@ tor_strisnonupper(const char *s) return 1; } +/** Return true iff every character in <b>s</b> is whitespace space; else + * return false. */ +int +tor_strisspace(const char *s) +{ + while (*s) { + if (!TOR_ISSPACE(*s)) + return 0; + s++; + } + return 1; +} + /** As strcmp, except that either string may be NULL. The NULL string is * considered to be before any non-NULL string. */ int |