mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-27 22:03:31 +01:00
isspace and friends take an int. solaris cares.
svn:r1303
This commit is contained in:
parent
51750ae09a
commit
c195f69058
@ -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;
|
||||
|
@ -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. */
|
||||
|
@ -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) ||
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user