]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
isspace and friends take an int. solaris cares.
authorRoger Dingledine <arma@torproject.org>
Fri, 19 Mar 2004 20:50:12 +0000 (20:50 +0000)
committerRoger Dingledine <arma@torproject.org>
Fri, 19 Mar 2004 20:50:12 +0000 (20:50 +0000)
svn:r1303

src/common/crypto.c
src/common/util.c
src/or/directory.c
src/or/onion.c

index 4f5a14d6dc55f36532700838348213ccbbf972f2..2b2f3b3118ab921d14d5d1ba71fc5e7f8d6d36f4 100644 (file)
@@ -691,9 +691,9 @@ crypto_pk_check_fingerprint_syntax(const char *s)
   int i;
   for (i = 0; i < FINGERPRINT_LEN; ++i) {
     if ((i%5) == 4) {
-      if (!isspace(s[i])) return 0;
+      if (!isspace((int)s[i])) return 0;
     } else {
-      if (!isxdigit(s[i])) return 0;
+      if (!isxdigit((int)s[i])) return 0;
     }
   }
   if (s[FINGERPRINT_LEN]) return 0;
index f3ffe676e79571d84e2407085a0968442a265935..77e7916d867e48e641378b92c674b344e740dcc7 100644 (file)
@@ -163,8 +163,8 @@ void *smartlist_choose(smartlist_t *sl) {
 const char *eat_whitespace(const char *s) {
   assert(s);
 
-  while(isspace(*s) || *s == '#') {
-    while(isspace(*s))
+  while(isspace((int)*s) || *s == '#') {
+    while(isspace((int)*s))
       s++;
     if(*s == '#') { /* read to a \n or \0 */
       while(*s && *s != '\n')
@@ -186,7 +186,7 @@ const char *eat_whitespace_no_nl(const char *s) {
 const char *find_whitespace(const char *s) {
   assert(s);
 
-  while(*s && !isspace(*s) && *s != '#')
+  while(*s && !isspace((int)*s) && *s != '#')
     s++;
 
   return s;
@@ -672,18 +672,18 @@ try_next_line:
   do {
     *s = 0;
     s--;
-  } while (s >= line && isspace(*s));
+  } while (s >= line && isspace((int)*s));
 
   key = line;
-  while(isspace(*key))
+  while(isspace((int)*key))
     key++;
   if(*key == 0)
     goto try_next_line; /* this line has nothing on it */
   end = key;
-  while(*end && !isspace(*end))
+  while(*end && !isspace((int)*end))
     end++;
   value = end;
-  while(*value && isspace(*value))
+  while(*value && isspace((int)*value))
     value++;
 
   if(!*end || !*value) { /* only a key on this line. no value. */
index d6be10eff71174486361ac4853b48a2a7188456a..f3f4025cdf2f3c1cabbf5c5933a79306277cdf64 100644 (file)
@@ -105,7 +105,7 @@ int parse_http_response(char *headers, int *code, char **message) {
   int n1, n2;
   assert(headers && code);
 
-  while(isspace(*headers)) headers++; /* tolerate leading whitespace */
+  while(isspace((int)*headers)) headers++; /* tolerate leading whitespace */
 
   if(sscanf(headers, "HTTP/1.%d %d", &n1, &n2) < 2 ||
      (n1 != 0 && n1 != 1) ||
index 8293b27dcbc2cb358d2fa6341d65c077bf764ec7..8dc3efa90486f4e03660adabb024dae24ec15b4a 100644 (file)
@@ -164,11 +164,11 @@ static void add_nickname_list_to_smartlist(smartlist_t *sl, char *list) {
   char nick[MAX_NICKNAME_LEN];
   routerinfo_t *router;
 
-  while(isspace(*list) || *list==',') list++;
+  while(isspace((int)*list) || *list==',') list++;
 
   start = list;
   while(*start) {
-    end=start; while(*end && !isspace(*end) && *end != ',') end++;
+    end=start; while(*end && !isspace((int)*end) && *end != ',') end++;
     memcpy(nick,start,end-start);
     nick[end-start] = 0; /* null terminate it */
     router = router_get_by_nickname(nick);
@@ -180,7 +180,7 @@ static void add_nickname_list_to_smartlist(smartlist_t *sl, char *list) {
     } else
       log_fn(has_fetched_directory ? LOG_WARN : LOG_INFO,
              "Nickname list includes '%s' which isn't a known router.",nick);
-    while(isspace(*end) || *end==',') end++;
+    while(isspace((int)*end) || *end==',') end++;
     start = end;
   }
 }