mirror of
https://github.com/NLnetLabs/unbound.git
synced 2025-12-20 23:00:56 -05:00
- Fix ctype invocation casts.
git-svn-id: file:///svn/unbound/trunk@3241 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
parent
71eab23c63
commit
f607500a2c
3 changed files with 26 additions and 24 deletions
|
|
@ -1,5 +1,6 @@
|
||||||
13 October 2014: Wouter
|
13 October 2014: Wouter
|
||||||
- Fix #617: in ldns in unbound, lowercase WKS services.
|
- Fix #617: in ldns in unbound, lowercase WKS services.
|
||||||
|
- Fix ctype invocation casts.
|
||||||
|
|
||||||
10 October 2014: Wouter
|
10 October 2014: Wouter
|
||||||
- Fix unbound-checkconf check for module config with dns64 module.
|
- Fix unbound-checkconf check for module config with dns64 module.
|
||||||
|
|
|
||||||
|
|
@ -245,7 +245,7 @@ rrinternal_get_ttl(sldns_buffer* strbuf, char* token, size_t token_len,
|
||||||
}
|
}
|
||||||
*ttl = (uint32_t) sldns_str2period(token, &endptr);
|
*ttl = (uint32_t) sldns_str2period(token, &endptr);
|
||||||
|
|
||||||
if (strlen(token) > 0 && !isdigit((int)token[0])) {
|
if (strlen(token) > 0 && !isdigit((unsigned char)token[0])) {
|
||||||
*not_there = 1;
|
*not_there = 1;
|
||||||
/* ah, it's not there or something */
|
/* ah, it's not there or something */
|
||||||
if (default_ttl == 0) {
|
if (default_ttl == 0) {
|
||||||
|
|
@ -388,7 +388,7 @@ rrinternal_spool_hex(char* token, uint8_t* rr, size_t rr_len,
|
||||||
p++;
|
p++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if(!isxdigit(*p))
|
if(!isxdigit((unsigned char)*p))
|
||||||
return RET_ERR(LDNS_WIREPARSE_ERR_SYNTAX_RDATA,
|
return RET_ERR(LDNS_WIREPARSE_ERR_SYNTAX_RDATA,
|
||||||
p-token);
|
p-token);
|
||||||
if(*cur_hex_data_size >= hex_data_size)
|
if(*cur_hex_data_size >= hex_data_size)
|
||||||
|
|
@ -1201,7 +1201,7 @@ int sldns_str2wire_hex_buf(const char* str, uint8_t* rd, size_t* len)
|
||||||
s++;
|
s++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if(!isxdigit(*s))
|
if(!isxdigit((unsigned char)*s))
|
||||||
return RET_ERR(LDNS_WIREPARSE_ERR_SYNTAX_HEX, s-str);
|
return RET_ERR(LDNS_WIREPARSE_ERR_SYNTAX_HEX, s-str);
|
||||||
if(*len < dlen/2 + 1)
|
if(*len < dlen/2 + 1)
|
||||||
return RET_ERR(LDNS_WIREPARSE_ERR_BUFFER_TOO_SMALL,
|
return RET_ERR(LDNS_WIREPARSE_ERR_BUFFER_TOO_SMALL,
|
||||||
|
|
@ -1401,7 +1401,7 @@ static int
|
||||||
loc_parse_cm(char* my_str, char** endstr, uint8_t* m, uint8_t* e)
|
loc_parse_cm(char* my_str, char** endstr, uint8_t* m, uint8_t* e)
|
||||||
{
|
{
|
||||||
uint32_t meters = 0, cm = 0, val;
|
uint32_t meters = 0, cm = 0, val;
|
||||||
while (isblank(*my_str)) {
|
while (isblank((unsigned char)*my_str)) {
|
||||||
my_str++;
|
my_str++;
|
||||||
}
|
}
|
||||||
meters = (uint32_t)strtol(my_str, &my_str, 10);
|
meters = (uint32_t)strtol(my_str, &my_str, 10);
|
||||||
|
|
@ -1452,17 +1452,17 @@ int sldns_str2wire_loc_buf(const char* str, uint8_t* rd, size_t* len)
|
||||||
|
|
||||||
char *my_str = (char *) str;
|
char *my_str = (char *) str;
|
||||||
|
|
||||||
if (isdigit((int) *my_str)) {
|
if (isdigit((unsigned char) *my_str)) {
|
||||||
h = (uint32_t) strtol(my_str, &my_str, 10);
|
h = (uint32_t) strtol(my_str, &my_str, 10);
|
||||||
} else {
|
} else {
|
||||||
return LDNS_WIREPARSE_ERR_INVALID_STR;
|
return LDNS_WIREPARSE_ERR_INVALID_STR;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (isblank((int) *my_str)) {
|
while (isblank((unsigned char) *my_str)) {
|
||||||
my_str++;
|
my_str++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isdigit((int) *my_str)) {
|
if (isdigit((unsigned char) *my_str)) {
|
||||||
m = (uint32_t) strtol(my_str, &my_str, 10);
|
m = (uint32_t) strtol(my_str, &my_str, 10);
|
||||||
} else if (*my_str == 'N' || *my_str == 'S') {
|
} else if (*my_str == 'N' || *my_str == 'S') {
|
||||||
goto north;
|
goto north;
|
||||||
|
|
@ -1470,16 +1470,16 @@ int sldns_str2wire_loc_buf(const char* str, uint8_t* rd, size_t* len)
|
||||||
return LDNS_WIREPARSE_ERR_INVALID_STR;
|
return LDNS_WIREPARSE_ERR_INVALID_STR;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (isblank((int) *my_str)) {
|
while (isblank((unsigned char) *my_str)) {
|
||||||
my_str++;
|
my_str++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isdigit((int) *my_str)) {
|
if (isdigit((unsigned char) *my_str)) {
|
||||||
s = strtod(my_str, &my_str);
|
s = strtod(my_str, &my_str);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* skip blanks before norterness */
|
/* skip blanks before norterness */
|
||||||
while (isblank((int) *my_str)) {
|
while (isblank((unsigned char) *my_str)) {
|
||||||
my_str++;
|
my_str++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1506,21 +1506,21 @@ north:
|
||||||
} else {
|
} else {
|
||||||
latitude = equator - latitude;
|
latitude = equator - latitude;
|
||||||
}
|
}
|
||||||
while (isblank(*my_str)) {
|
while (isblank((unsigned char)*my_str)) {
|
||||||
my_str++;
|
my_str++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isdigit((int) *my_str)) {
|
if (isdigit((unsigned char) *my_str)) {
|
||||||
h = (uint32_t) strtol(my_str, &my_str, 10);
|
h = (uint32_t) strtol(my_str, &my_str, 10);
|
||||||
} else {
|
} else {
|
||||||
return LDNS_WIREPARSE_ERR_INVALID_STR;
|
return LDNS_WIREPARSE_ERR_INVALID_STR;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (isblank((int) *my_str)) {
|
while (isblank((unsigned char) *my_str)) {
|
||||||
my_str++;
|
my_str++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isdigit((int) *my_str)) {
|
if (isdigit((unsigned char) *my_str)) {
|
||||||
m = (uint32_t) strtol(my_str, &my_str, 10);
|
m = (uint32_t) strtol(my_str, &my_str, 10);
|
||||||
} else if (*my_str == 'E' || *my_str == 'W') {
|
} else if (*my_str == 'E' || *my_str == 'W') {
|
||||||
goto east;
|
goto east;
|
||||||
|
|
@ -1528,16 +1528,16 @@ north:
|
||||||
return LDNS_WIREPARSE_ERR_INVALID_STR;
|
return LDNS_WIREPARSE_ERR_INVALID_STR;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (isblank(*my_str)) {
|
while (isblank((unsigned char)*my_str)) {
|
||||||
my_str++;
|
my_str++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isdigit((int) *my_str)) {
|
if (isdigit((unsigned char) *my_str)) {
|
||||||
s = strtod(my_str, &my_str);
|
s = strtod(my_str, &my_str);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* skip blanks before easterness */
|
/* skip blanks before easterness */
|
||||||
while (isblank(*my_str)) {
|
while (isblank((unsigned char)*my_str)) {
|
||||||
my_str++;
|
my_str++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1707,7 +1707,7 @@ int sldns_str2wire_nsap_buf(const char* str, uint8_t* rd, size_t* len)
|
||||||
s++;
|
s++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if(!isxdigit(*s))
|
if(!isxdigit((unsigned char)*s))
|
||||||
return RET_ERR(LDNS_WIREPARSE_ERR_SYNTAX_HEX, s-str);
|
return RET_ERR(LDNS_WIREPARSE_ERR_SYNTAX_HEX, s-str);
|
||||||
if(*len < dlen/2 + 1)
|
if(*len < dlen/2 + 1)
|
||||||
return RET_ERR(LDNS_WIREPARSE_ERR_BUFFER_TOO_SMALL,
|
return RET_ERR(LDNS_WIREPARSE_ERR_BUFFER_TOO_SMALL,
|
||||||
|
|
@ -1738,7 +1738,7 @@ int sldns_str2wire_atma_buf(const char* str, uint8_t* rd, size_t* len)
|
||||||
s++;
|
s++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if(!isxdigit(*s))
|
if(!isxdigit((unsigned char)*s))
|
||||||
return RET_ERR(LDNS_WIREPARSE_ERR_SYNTAX_HEX, s-str);
|
return RET_ERR(LDNS_WIREPARSE_ERR_SYNTAX_HEX, s-str);
|
||||||
if(*len < dlen/2 + 1)
|
if(*len < dlen/2 + 1)
|
||||||
return RET_ERR(LDNS_WIREPARSE_ERR_BUFFER_TOO_SMALL,
|
return RET_ERR(LDNS_WIREPARSE_ERR_BUFFER_TOO_SMALL,
|
||||||
|
|
@ -1841,7 +1841,8 @@ int sldns_str2wire_nsec3_salt_buf(const char* str, uint8_t* rd, size_t* len)
|
||||||
return LDNS_WIREPARSE_ERR_BUFFER_TOO_SMALL;
|
return LDNS_WIREPARSE_ERR_BUFFER_TOO_SMALL;
|
||||||
rd[0] = (uint8_t) (salt_length_str / 2);
|
rd[0] = (uint8_t) (salt_length_str / 2);
|
||||||
for (i = 0; i < salt_length_str; i += 2) {
|
for (i = 0; i < salt_length_str; i += 2) {
|
||||||
if (isxdigit((int)str[i]) && isxdigit((int)str[i+1])) {
|
if (isxdigit((unsigned char)str[i]) &&
|
||||||
|
isxdigit((unsigned char)str[i+1])) {
|
||||||
rd[1+i/2] = (uint8_t)(sldns_hexdigit_to_int(str[i])*16
|
rd[1+i/2] = (uint8_t)(sldns_hexdigit_to_int(str[i])*16
|
||||||
+ sldns_hexdigit_to_int(str[i+1]));
|
+ sldns_hexdigit_to_int(str[i+1]));
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -722,7 +722,7 @@ static int dname_char_print(char** s, size_t* slen, uint8_t c)
|
||||||
{
|
{
|
||||||
if(c == '.' || c == ';' || c == '(' || c == ')' || c == '\\')
|
if(c == '.' || c == ';' || c == '(' || c == ')' || c == '\\')
|
||||||
return sldns_str_print(s, slen, "\\%c", c);
|
return sldns_str_print(s, slen, "\\%c", c);
|
||||||
else if(!(isascii((int)c) && isgraph((int)c)))
|
else if(!(isascii((unsigned char)c) && isgraph((unsigned char)c)))
|
||||||
return sldns_str_print(s, slen, "\\%03u", (unsigned)c);
|
return sldns_str_print(s, slen, "\\%03u", (unsigned)c);
|
||||||
/* plain printout */
|
/* plain printout */
|
||||||
if(*slen) {
|
if(*slen) {
|
||||||
|
|
@ -1064,7 +1064,7 @@ int sldns_wire2str_aaaa_scan(uint8_t** d, size_t* dl, char** s, size_t* sl)
|
||||||
/** printout escaped TYPE_STR character */
|
/** printout escaped TYPE_STR character */
|
||||||
static int str_char_print(char** s, size_t* sl, uint8_t c)
|
static int str_char_print(char** s, size_t* sl, uint8_t c)
|
||||||
{
|
{
|
||||||
if(isprint((int)c) || c == '\t') {
|
if(isprint((unsigned char)c) || c == '\t') {
|
||||||
if(c == '\"' || c == '\\')
|
if(c == '\"' || c == '\\')
|
||||||
return sldns_str_print(s, sl, "\\%c", c);
|
return sldns_str_print(s, sl, "\\%c", c);
|
||||||
if(*sl) {
|
if(*sl) {
|
||||||
|
|
@ -1625,7 +1625,7 @@ int sldns_wire2str_tag_scan(uint8_t** d, size_t* dl, char** s, size_t* sl)
|
||||||
if(*dl < 1+n)
|
if(*dl < 1+n)
|
||||||
return -1;
|
return -1;
|
||||||
for(i=0; i<n; i++)
|
for(i=0; i<n; i++)
|
||||||
if(!isalnum((int)(*d)[i]))
|
if(!isalnum((unsigned char)(*d)[i]))
|
||||||
return -1;
|
return -1;
|
||||||
for(i=0; i<n; i++)
|
for(i=0; i<n; i++)
|
||||||
w += sldns_str_print(s, sl, "%c", (char)(*d)[i]);
|
w += sldns_str_print(s, sl, "%c", (char)(*d)[i]);
|
||||||
|
|
@ -1713,7 +1713,7 @@ int sldns_wire2str_edns_nsid_print(char** s, size_t* sl, uint8_t* data,
|
||||||
size_t i, printed=0;
|
size_t i, printed=0;
|
||||||
w += print_hex_buf(s, sl, data, len);
|
w += print_hex_buf(s, sl, data, len);
|
||||||
for(i=0; i<len; i++) {
|
for(i=0; i<len; i++) {
|
||||||
if(isprint((int)data[i]) || data[i] == '\t') {
|
if(isprint((unsigned char)data[i]) || data[i] == '\t') {
|
||||||
if(!printed) {
|
if(!printed) {
|
||||||
w += sldns_str_print(s, sl, " (");
|
w += sldns_str_print(s, sl, " (");
|
||||||
printed = 1;
|
printed = 1;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue