aboutsummaryrefslogtreecommitdiff
path: root/src/common/util.c
diff options
context:
space:
mode:
authorrl1987 <rl1987@sdf.lonestar.org>2018-02-12 21:26:57 +0100
committerNick Mathewson <nickm@torproject.org>2018-03-28 07:39:03 -0400
commit6335db9fce4275838c7de4bc10e522eb21a21ed8 (patch)
treef6aba79571deed4832e14846a2f144977f4ffc2a /src/common/util.c
parent12afd8bfed96c57cd47b18644c2030673496a74f (diff)
downloadtor-6335db9fce4275838c7de4bc10e522eb21a21ed8.tar.gz
tor-6335db9fce4275838c7de4bc10e522eb21a21ed8.zip
Refrain from including <ctype.h>
Diffstat (limited to 'src/common/util.c')
-rw-r--r--src/common/util.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/common/util.c b/src/common/util.c
index d8891c6a53..a7eaf5389c 100644
--- a/src/common/util.c
+++ b/src/common/util.c
@@ -100,8 +100,6 @@
#undef MALLOC_ZERO_WORKS
#endif
-#include <ctype.h>
-
/* =====
* Memory management
* ===== */
@@ -1128,12 +1126,12 @@ string_is_valid_hostname(const char *string)
if (c_sl_idx == c_sl_len - 1) {
do {
- result = isalpha(*c);
+ result = TOR_ISALPHA(*c);
c++;
} while (result && *c);
} else {
do {
- result = (isalnum(*c) || (*c == '-') || (*c == '_'));
+ result = (TOR_ISALNUM(*c) || (*c == '-') || (*c == '_'));
c++;
} while (result > 0 && *c);
}