for(s=dname_str; *s; s++) {
if(*s == '\\') {
if(s[1] && s[2] && s[3] /* check length */
- && isdigit(s[1]) && isdigit(s[2]) &&
- isdigit(s[3]))
+ && isdigit((unsigned char)s[1])
+ && isdigit((unsigned char)s[2])
+ && isdigit((unsigned char)s[3]))
s += 3;
- else if(!s[1] || isdigit(s[1])) /* escape of nul,0-9 */
+ else if(!s[1] || isdigit((unsigned char)s[1])) /* escape of nul,0-9 */
return 0; /* parse error */
else s++; /* another character escaped */
}
a = lt->id;
} else {
i = atoi(value);
- if (i >= 0 && !isdigit(value[0]) == 0) {
+ if (i >= 0 && !isdigit((unsigned char)value[0]) == 0) {
lt = ldns_lookup_by_id(ldns_opcodes, i);
if (lt) {
a = lt->id;
b = lt->id;
} else {
i = atoi(mvalue);
- if (i >= 0 && !isdigit(mvalue[0]) == 0) {
+ if (i >= 0 && !isdigit((unsigned char)mvalue[0]) == 0) {
lt = ldns_lookup_by_id(ldns_opcodes, i);
if (lt) {
b = lt->id;
a = lt->id;
} else {
i = atoi(value);
- if (i >= 0 && !isdigit(value[0]) == 0) {
+ if (i >= 0 && !isdigit((unsigned char)value[0]) == 0) {
lt = ldns_lookup_by_id(ldns_rcodes, i);
if (lt) {
a = lt->id;
} else {
i = atoi(mvalue);
- if (i >= 0 && !isdigit(mvalue[0]) == 0) {
+ if (i >= 0 && !isdigit((unsigned char)mvalue[0]) == 0) {
lt = ldns_lookup_by_id(ldns_rcodes, i);
if (lt) {
b = lt->id;
j = 0;
for (i = 0; i < strlen(string); i++) {
- if(!isspace(string[i])) {
+ if(!isspace((unsigned char)string[i])) {
str[j] = string[i];
j++;
}
str = malloc(strlen(string) + 1);
j = 0;
for (i = 0; i < strlen(string); i++) {
- if (!isspace(string[i])) {
+ if (!isspace((unsigned char)string[i])) {
str[j] = string[i];
j++;
}
if(strncmp(*str, keyword, len) != 0)
return false;
*str += len;
- while(isspace(**str))
+ while(isspace((unsigned char)**str))
(*str)++;
return true;
}
error("expected = or : in MATCH: %s", line);
parse++;
e->ixfr_soa_serial = (uint32_t)strtol(parse, (char**)&parse, 10);
- while(isspace(*parse))
+ while(isspace((unsigned char)*parse))
parse++;
} else {
error("could not parse MATCH: '%s'", parse);
e->copy_id = true;
} else if(str_keyword(&parse, "sleep=")) {
e->sleeptime = strtol(parse, (char**)&parse, 10);
- while(isspace(*parse))
+ while(isspace((unsigned char)*parse))
parse++;
} else if(str_keyword(&parse, "packet_sleep=")) {
pkt->packet_sleep = strtol(parse, (char**)&parse, 10);
- while(isspace(*parse))
+ while(isspace((unsigned char)*parse))
parse++;
} else {
error("could not parse ADJUST: '%s'", parse);
*origin = NULL;
end=parse;
- while(!isspace(*end) && !isendline(*end))
+ while(!isspace((unsigned char)*end) && !isendline(*end))
end++;
store = *end;
*end = 0;
parse = line;
lineno ++;
- while(isspace(*parse))
+ while(isspace((unsigned char)*parse))
parse++;
/* test for keywords */
if(isendline(*parse))
chars = ldns_rdf_data(rdf) + 1;
while (nchars > 0) {
ch = (char)*chars++;
- if (! isalnum(ch)) {
+ if (! isalnum((unsigned char)ch)) {
return LDNS_STATUS_WIRE_RDATA_ERR;
}
ldns_buffer_printf(output, "%c", ch);
{
char *s = line, *e;
- for (s = line; *s && isspace(*s); s++)
+ for (s = line; *s && isspace((unsigned char)*s); s++)
;
- for (e = strchr(s, 0); e > s+2 && isspace(e[-1]) && e[-2] != '\\'; e--)
+ for (e = strchr(s, 0); e > s+2 && isspace((unsigned char)e[-1]) && e[-2] != '\\'; e--)
;
*e = 0;
return LDNS_STATUS_SYNTAX_EMPTY;
}
- if (strncmp(line, "$ORIGIN", 7) == 0 && isspace(line[7])) {
+ if (strncmp(line, "$ORIGIN", 7) == 0 && isspace((unsigned char)line[7])) {
if (*origin) {
ldns_rdf_deep_free(*origin);
*origin = NULL;
}
*origin = tmp;
s = LDNS_STATUS_SYNTAX_ORIGIN;
- } else if (strncmp(line, "$TTL", 4) == 0 && isspace(line[4])) {
+ } else if (strncmp(line, "$TTL", 4) == 0 && isspace((unsigned char)line[4])) {
if (default_ttl) {
*default_ttl = ldns_str2period(
ldns_strip_ws(line + 5), &endptr);
{
uint16_t val;
- if ((*str_p)[0] && isdigit((*str_p)[0]) &&
- (*str_p)[1] && isdigit((*str_p)[1]) &&
- (*str_p)[2] && isdigit((*str_p)[2])) {
+ if ((*str_p)[0] && isdigit((unsigned char)(*str_p)[0]) &&
+ (*str_p)[1] && isdigit((unsigned char)(*str_p)[1]) &&
+ (*str_p)[2] && isdigit((unsigned char)(*str_p)[2])) {
val = (uint16_t)(((*str_p)[0] - '0') * 100 +
((*str_p)[1] - '0') * 10 +
*str_p += 3;
return true;
- } else if ((*str_p)[0] && !isdigit((*str_p)[0])) {
+ } else if ((*str_p)[0] && !isdigit((unsigned char)(*str_p)[0])) {
*ch_p = (uint8_t)*(*str_p)++;
return true;
/* read <digits>[.<digits>][mM] */
/* into mantissa exponent format for LOC type */
uint32_t meters = 0, cm = 0, val;
- while (isblank(*my_str)) {
+ while (isblank((unsigned char)*my_str)) {
my_str++;
}
meters = (uint32_t)strtol(my_str, &my_str, 10);
} else {
latitude = equator - latitude;
}
- while (isblank(*my_str)) {
+ while (isblank((unsigned char)*my_str)) {
my_str++;
}
return LDNS_STATUS_INVALID_STR;
}
- while (isblank(*my_str)) {
+ while (isblank((unsigned char)*my_str)) {
my_str++;
}
}
east:
- while (isblank(*my_str)) {
+ while (isblank((unsigned char)*my_str)) {
my_str++;
}
return LDNS_STATUS_INVALID_TAG;
}
for (ptr = str; *ptr; ptr++) {
- if (! isalnum(*ptr)) {
+ if (! isalnum((unsigned char)*ptr)) {
return LDNS_STATUS_INVALID_TAG;
}
}
ch = *src++;
--src_sz;
- } while (isspace(ch) && src_sz > 0);
+ } while (isspace((unsigned char)ch) && src_sz > 0);
if (ch == '=' || ch == '\0')
break;
ch = *src++;
src_sz--;
- } while (isspace(ch));
+ } while (isspace((unsigned char)ch));
if (ch != '=')
return -1;