More unsigned chasts for toupper/tolower/ctype

git-svn-id: file:///svn/unbound/trunk@3242 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
Wouter Wijngaards
2014-10-13 08:35:00 +00:00
parent f607500a2c
commit 339a6be27d
12 changed files with 47 additions and 47 deletions
+3 -3
View File
@@ -49,7 +49,7 @@ static void
skip_whites(const char** p)
{
while(1) {
while(isspace((int)**p))
while(isspace((unsigned char)**p))
(*p)++;
if(**p == ';') {
/* comment, skip until newline */
@@ -71,11 +71,11 @@ void hex_to_buf(sldns_buffer* pkt, const char* hex)
skip_whites(&p);
if(sldns_buffer_position(pkt) == sldns_buffer_limit(pkt))
fatal_exit("hex_to_buf: buffer too small");
if(!isalnum((int)*p))
if(!isalnum((unsigned char)*p))
break;
val = sldns_hexdigit_to_int(*p++) << 4;
skip_whites(&p);
log_assert(*p && isalnum((int)*p));
log_assert(*p && isalnum((unsigned char)*p));
val |= sldns_hexdigit_to_int(*p++);
sldns_buffer_write_u8(pkt, (uint8_t)val);
skip_whites(&p);
+6 -6
View File
@@ -651,7 +651,7 @@ do_macro_variable(rbtree_t* store, char* buf, size_t remain)
char sv;
if(at[0]==0)
return NULL; /* no variable name after $ */
while(*at && (isalnum((int)*at) || *at=='_')) {
while(*at && (isalnum((unsigned char)*at) || *at=='_')) {
at++;
}
/* terminator, we are working in macro_expand() buffer */
@@ -724,7 +724,7 @@ do_macro_arith(char* orig, size_t remain, char** arithstart)
/* remember start pos of expr, skip the first number */
at = orig;
*arithstart = at;
while(*at && (isdigit((int)*at) || *at == '.'))
while(*at && (isdigit((unsigned char)*at) || *at == '.'))
at++;
return at;
}
@@ -737,7 +737,7 @@ do_macro_arith(char* orig, size_t remain, char** arithstart)
*arithstart = NULL;
return do_macro_arith(orig, remain, arithstart);
}
if(isdigit((int)operator)) {
if(isdigit((unsigned char)operator)) {
*arithstart = orig;
return at+skip; /* do nothing, but setup for later number */
}
@@ -820,13 +820,13 @@ macro_expand(rbtree_t* store, struct replay_runtime* runtime, char** text)
at = do_macro_recursion(store, runtime, at, remain);
} else if(*at == '$') {
at = do_macro_variable(store, at, remain);
} else if(isdigit((int)*at)) {
} else if(isdigit((unsigned char)*at)) {
at = do_macro_arith(at, remain, &arithstart);
} else {
/* copy until whitespace or operator */
if(*at && (isalnum((int)*at) || *at=='_')) {
if(*at && (isalnum((unsigned char)*at) || *at=='_')) {
at++;
while(*at && (isalnum((int)*at) || *at=='_'))
while(*at && (isalnum((unsigned char)*at) || *at=='_'))
at++;
} else at++;
}
+1 -1
View File
@@ -344,7 +344,7 @@ hex_buffer2wire(sldns_buffer *data_buffer)
for (data_buf_pos = 0; data_buf_pos < sldns_buffer_position(data_buffer); data_buf_pos++) {
c = (int) data_wire[data_buf_pos];
if (state < 2 && !isascii(c)) {
if (state < 2 && !isascii((unsigned char)c)) {
/*verbose("non ascii character found in file: (%d) switching to raw mode\n", c);*/
state = 2;
}