浏览代码

Refrain from including <ctype.h>

rl1987 7 年之前
父节点
当前提交
6335db9fce
共有 1 个文件被更改,包括 2 次插入4 次删除
  1. 2 4
      src/common/util.c

+ 2 - 4
src/common/util.c

@@ -100,8 +100,6 @@
 #undef MALLOC_ZERO_WORKS
 #undef MALLOC_ZERO_WORKS
 #endif
 #endif
 
 
-#include <ctype.h>
-
 /* =====
 /* =====
  * Memory management
  * Memory management
  * ===== */
  * ===== */
@@ -1128,12 +1126,12 @@ string_is_valid_hostname(const char *string)
 
 
     if (c_sl_idx == c_sl_len - 1) {
     if (c_sl_idx == c_sl_len - 1) {
       do {
       do {
-        result = isalpha(*c);
+        result = TOR_ISALPHA(*c);
         c++;
         c++;
       } while (result && *c);
       } while (result && *c);
     } else {
     } else {
       do {
       do {
-        result = (isalnum(*c) || (*c == '-') || (*c == '_'));
+        result = (TOR_ISALNUM(*c) || (*c == '-') || (*c == '_'));
         c++;
         c++;
       } while (result > 0 && *c);
       } while (result > 0 && *c);
     }
     }