summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2004-03-19 20:50:12 +0000
committerRoger Dingledine <arma@torproject.org>2004-03-19 20:50:12 +0000
commitc195f690583bd5f6bd7c0c760ee15fed944bbd7c (patch)
treedda31dd126abc4e888fbd6b20e5d9f4d0ac1cf16
parent51750ae09a162bd9de70e9163213d3a07788ea9d (diff)
downloadtor-c195f690583bd5f6bd7c0c760ee15fed944bbd7c.tar.gz
tor-c195f690583bd5f6bd7c0c760ee15fed944bbd7c.zip
isspace and friends take an int. solaris cares.
svn:r1303
-rw-r--r--src/common/crypto.c4
-rw-r--r--src/common/util.c14
-rw-r--r--src/or/directory.c2
-rw-r--r--src/or/onion.c6
4 files changed, 13 insertions, 13 deletions
diff --git a/src/common/crypto.c b/src/common/crypto.c
index 4f5a14d6dc..2b2f3b3118 100644
--- a/src/common/crypto.c
+++ b/src/common/crypto.c
@@ -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;
diff --git a/src/common/util.c b/src/common/util.c
index f3ffe676e7..77e7916d86 100644
--- a/src/common/util.c
+++ b/src/common/util.c
@@ -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. */
diff --git a/src/or/directory.c b/src/or/directory.c
index d6be10eff7..f3f4025cdf 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -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) ||
diff --git a/src/or/onion.c b/src/or/onion.c
index 8293b27dcb..8dc3efa904 100644
--- a/src/or/onion.c
+++ b/src/or/onion.c
@@ -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;
}
}