isspace and friends take an int. solaris cares.

svn:r1303
This commit is contained in:
Roger Dingledine 2004-03-19 20:50:12 +00:00
parent 51750ae09a
commit c195f69058
4 changed files with 13 additions and 13 deletions

View File

@ -691,9 +691,9 @@ crypto_pk_check_fingerprint_syntax(const char *s)
int i; int i;
for (i = 0; i < FINGERPRINT_LEN; ++i) { for (i = 0; i < FINGERPRINT_LEN; ++i) {
if ((i%5) == 4) { if ((i%5) == 4) {
if (!isspace(s[i])) return 0; if (!isspace((int)s[i])) return 0;
} else { } else {
if (!isxdigit(s[i])) return 0; if (!isxdigit((int)s[i])) return 0;
} }
} }
if (s[FINGERPRINT_LEN]) return 0; if (s[FINGERPRINT_LEN]) return 0;

View File

@ -163,8 +163,8 @@ void *smartlist_choose(smartlist_t *sl) {
const char *eat_whitespace(const char *s) { const char *eat_whitespace(const char *s) {
assert(s); assert(s);
while(isspace(*s) || *s == '#') { while(isspace((int)*s) || *s == '#') {
while(isspace(*s)) while(isspace((int)*s))
s++; s++;
if(*s == '#') { /* read to a \n or \0 */ if(*s == '#') { /* read to a \n or \0 */
while(*s && *s != '\n') while(*s && *s != '\n')
@ -186,7 +186,7 @@ const char *eat_whitespace_no_nl(const char *s) {
const char *find_whitespace(const char *s) { const char *find_whitespace(const char *s) {
assert(s); assert(s);
while(*s && !isspace(*s) && *s != '#') while(*s && !isspace((int)*s) && *s != '#')
s++; s++;
return s; return s;
@ -672,18 +672,18 @@ try_next_line:
do { do {
*s = 0; *s = 0;
s--; s--;
} while (s >= line && isspace(*s)); } while (s >= line && isspace((int)*s));
key = line; key = line;
while(isspace(*key)) while(isspace((int)*key))
key++; key++;
if(*key == 0) if(*key == 0)
goto try_next_line; /* this line has nothing on it */ goto try_next_line; /* this line has nothing on it */
end = key; end = key;
while(*end && !isspace(*end)) while(*end && !isspace((int)*end))
end++; end++;
value = end; value = end;
while(*value && isspace(*value)) while(*value && isspace((int)*value))
value++; value++;
if(!*end || !*value) { /* only a key on this line. no value. */ if(!*end || !*value) { /* only a key on this line. no value. */

View File

@ -105,7 +105,7 @@ int parse_http_response(char *headers, int *code, char **message) {
int n1, n2; int n1, n2;
assert(headers && code); 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 || if(sscanf(headers, "HTTP/1.%d %d", &n1, &n2) < 2 ||
(n1 != 0 && n1 != 1) || (n1 != 0 && n1 != 1) ||

View File

@ -164,11 +164,11 @@ static void add_nickname_list_to_smartlist(smartlist_t *sl, char *list) {
char nick[MAX_NICKNAME_LEN]; char nick[MAX_NICKNAME_LEN];
routerinfo_t *router; routerinfo_t *router;
while(isspace(*list) || *list==',') list++; while(isspace((int)*list) || *list==',') list++;
start = list; start = list;
while(*start) { while(*start) {
end=start; while(*end && !isspace(*end) && *end != ',') end++; end=start; while(*end && !isspace((int)*end) && *end != ',') end++;
memcpy(nick,start,end-start); memcpy(nick,start,end-start);
nick[end-start] = 0; /* null terminate it */ nick[end-start] = 0; /* null terminate it */
router = router_get_by_nickname(nick); router = router_get_by_nickname(nick);
@ -180,7 +180,7 @@ static void add_nickname_list_to_smartlist(smartlist_t *sl, char *list) {
} else } else
log_fn(has_fetched_directory ? LOG_WARN : LOG_INFO, log_fn(has_fetched_directory ? LOG_WARN : LOG_INFO,
"Nickname list includes '%s' which isn't a known router.",nick); "Nickname list includes '%s' which isn't a known router.",nick);
while(isspace(*end) || *end==',') end++; while(isspace((int)*end) || *end==',') end++;
start = end; start = end;
} }
} }