while ((c = *format) != '\0') {
/* whitespace, literal or format */
- if (isspace(c)) { /* whitespace */
+ if (isspace((unsigned char)c)) { /* whitespace */
/** whitespace matches zero or more whitespace characters in the
* input string.
**/
- while (isspace(*s))
+ while (isspace((unsigned char)*s))
s++;
}
else if (c == '%') { /* format */
break;
case 'n': /* arbitrary whitespace */
case 't':
- while (isspace(*s))
+ while (isspace((unsigned char)*s))
s++;
break;
case 'p': /* am pm */
skipwhite(char* str)
{
/* EOS \0 is not a space */
- while( isspace(*str) )
+ while( isspace((unsigned char)*str) )
str++;
return str;
}
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;
{
char* p = token;
while(*p) {
- if(isspace(*p)) {
+ if(isspace((unsigned char)*p)) {
p++;
continue;
}
{
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 s;
return LDNS_WIREPARSE_ERR_OK;
}
- if(strncmp(line, "$ORIGIN", 7) == 0 && isspace(line[7])) {
+ if(strncmp(line, "$ORIGIN", 7) == 0 && isspace((unsigned char)line[7])) {
int s;
*len = 0;
*dname_len = 0;
parse_state->origin, &parse_state->origin_len);
if(s) parse_state->origin_len = 0;
return s;
- } else if(strncmp(line, "$TTL", 4) == 0 && isspace(line[4])) {
+ } else if(strncmp(line, "$TTL", 4) == 0 && isspace((unsigned char)line[4])) {
const char* end = NULL;
*len = 0;
*dname_len = 0;
const char* s = str;
size_t dlen = 0; /* number of hexdigits parsed */
while(*s) {
- if(isspace(*s)) {
+ if(isspace((unsigned char)*s)) {
s++;
continue;
}
if(slen > LDNS_MAX_RDFLEN*2)
return LDNS_WIREPARSE_ERR_LABEL_OVERFLOW;
while(*s) {
- if(isspace(*s) || *s == '.') {
+ if(isspace((unsigned char)*s) || *s == '.') {
s++;
continue;
}
if(slen > LDNS_MAX_RDFLEN*2)
return LDNS_WIREPARSE_ERR_LABEL_OVERFLOW;
while(*s) {
- if(isspace(*s) || *s == '.') {
+ if(isspace((unsigned char)*s) || *s == '.') {
s++;
continue;
}
return 0;
while(*s) {
/* skip whitespace */
- while(*s && isspace((int)*s))
+ while(*s && isspace((unsigned char)*s))
s++;
- if(*s && !isspace((int)*s)) {
+ if(*s && !isspace((unsigned char)*s)) {
/* skip identifier */
num++;
- while(*s && !isspace((int)*s))
+ while(*s && !isspace((unsigned char)*s))
s++;
}
}
const char* s = *str;
const char** names = module_list_avail();
fbgetfunctype* fb = module_funcs_avail();
- while(*s && isspace((int)*s))
+ while(*s && isspace((unsigned char)*s))
s++;
while(names[i]) {
if(strncmp(names[i], s, strlen(names[i])) == 0) {
{
size_t i;
for(i = strlen(p); i > 0; i--) {
- if(isspace((int)p[i-1]))
+ if(isspace((unsigned char)p[i-1]))
p[i-1] = 0;
else return;
}
while(fgets(line, MAX_LINE_LEN-1, in)) {
pstate->lineno++;
parse = line;
- while(isspace((int)*parse))
+ while(isspace((unsigned char)*parse))
parse++;
if(!*parse || *parse == ';') {
pos = ftello(in);
continue;
}
if(parse_keyword(&parse, "ADDRESS")) {
- while(isspace((int)*parse))
+ while(isspace((unsigned char)*parse))
parse++;
strip_end_white(parse);
if(!extstrtoaddr(parse, &rng->addr, &rng->addrlen)) {
return NULL;
}
remain += skip;
- while(isspace((int)*remain))
+ while(isspace((unsigned char)*remain))
remain++;
if(parse_keyword(&remain, "NOTHING")) {
mom->evt_type = repevt_nothing;
mom->evt_type = repevt_timeout;
} else if(parse_keyword(&remain, "TIME_PASSES")) {
mom->evt_type = repevt_time_passes;
- while(isspace((int)*remain))
+ while(isspace((unsigned char)*remain))
remain++;
if(parse_keyword(&remain, "EVAL")) {
- while(isspace((int)*remain))
+ while(isspace((unsigned char)*remain))
remain++;
mom->string = strdup(remain);
if(!mom->string) fatal_exit("out of memory");
}
} else if(parse_keyword(&remain, "CHECK_AUTOTRUST")) {
mom->evt_type = repevt_autotrust_check;
- while(isspace((int)*remain))
+ while(isspace((unsigned char)*remain))
remain++;
if(strlen(remain)>0 && remain[strlen(remain)-1]=='\n')
remain[strlen(remain)-1] = 0;
} else if(parse_keyword(&remain, "INFRA_RTT")) {
char *s, *m;
mom->evt_type = repevt_infra_rtt;
- while(isspace((int)*remain))
+ while(isspace((unsigned char)*remain))
remain++;
s = remain;
remain = strchr(s, ' ');
if(!remain) fatal_exit("expected three args for INFRA_RTT");
remain[0] = 0;
remain++;
- while(isspace((int)*remain))
+ while(isspace((unsigned char)*remain))
remain++;
m = strchr(remain, ' ');
if(!m) fatal_exit("expected three args for INFRA_RTT");
m[0] = 0;
m++;
- while(isspace((int)*m))
+ while(isspace((unsigned char)*m))
m++;
if(!extstrtoaddr(s, &mom->addr, &mom->addrlen))
fatal_exit("bad infra_rtt address %s", s);
free(mom);
return NULL;
}
- while(isspace((int)*remain))
+ while(isspace((unsigned char)*remain))
remain++;
if(parse_keyword(&remain, "ADDRESS")) {
- while(isspace((int)*remain))
+ while(isspace((unsigned char)*remain))
remain++;
if(strlen(remain) > 0) /* remove \n */
remain[strlen(remain)-1] = 0;
make_scenario(char* line)
{
struct replay_scenario* scen;
- while(isspace((int)*line))
+ while(isspace((unsigned char)*line))
line++;
if(!*line) {
log_err("scenario: no title given");
parse=line;
pstate.lineno++;
(*lineno)++;
- while(isspace((int)*parse))
+ while(isspace((unsigned char)*parse))
parse++;
if(!*parse)
continue; /* empty line */
{
const char *p = args, *np;
size_t len;
- while(p && isspace((int)*p))
+ while(p && isspace((unsigned char)*p))
p++;
while(p && *p) {
/* find location of next string and length of this one */
(*pass_argc)++;
/* go to next option */
p = np;
- while(p && isspace((int)*p))
+ while(p && isspace((unsigned char)*p))
p++;
}
}
char* parse;
FILE* spool;
/* find filename for new file */
- while(isspace((int)*id))
+ while(isspace((unsigned char)*id))
id++;
if(strlen(id)==0)
fatal_exit("AUTROTRUST_FILE must have id, line %d", *lineno);
while(fgets(line, MAX_LINE_LEN-1, in)) {
parse = line;
(*lineno)++;
- while(isspace((int)*parse))
+ while(isspace((unsigned char)*parse))
parse++;
if(strncmp(parse, "AUTOTRUST_END", 13) == 0) {
fclose(spool);
while(fgets(line, MAX_LINE_LEN-1, in)) {
parse = line;
(*lineno)++;
- while(isspace((int)*parse))
+ while(isspace((unsigned char)*parse))
parse++;
if(!*parse || parse[0] == ';')
continue;
if(strncmp(*str, keyword, len) != 0)
return 0;
*str += len;
- while(isspace((int)**str))
+ while(isspace((unsigned char)**str))
(*str)++;
return 1;
}
error("expected = or : in MATCH: %s", line);
parse++;
e->ixfr_soa_serial = (uint32_t)strtol(parse, (char**)&parse, 10);
- while(isspace((int)*parse))
+ while(isspace((unsigned char)*parse))
parse++;
} else {
error("could not parse MATCH: '%s'", parse);
e->copy_query = 1;
} else if(str_keyword(&parse, "sleep=")) {
e->sleeptime = (unsigned int) strtol(parse, (char**)&parse, 10);
- while(isspace((int)*parse))
+ while(isspace((unsigned char)*parse))
parse++;
} else if(str_keyword(&parse, "packet_sleep=")) {
pkt->packet_sleep = (unsigned int) strtol(parse, (char**)&parse, 10);
- while(isspace((int)*parse))
+ while(isspace((unsigned char)*parse))
parse++;
} else {
error("could not parse ADJUST: '%s'", parse);
int status;
end=parse;
- while(!isspace((int)*end) && !isendline(*end))
+ while(!isspace((unsigned char)*end) && !isendline(*end))
end++;
store = *end;
*end = 0;
parse = line;
pstate->lineno++;
- while(isspace((int)*parse))
+ while(isspace((unsigned char)*parse))
parse++;
/* test for keywords */
if(isendline(*parse))
/* sp ::= (space|tab)* */
int num = 0;
while(*s) {
- while(*s && isspace((int)*s))
+ while(*s && isspace((unsigned char)*s))
s++;
if(!*s) /* end of string */
break;
handle_origin(char* line, uint8_t** origin, size_t* origin_len)
{
size_t len = 0;
- while(isspace((int)*line))
+ while(isspace((unsigned char)*line))
line++;
if(strncmp(line, "$ORIGIN", 7) != 0)
return 0;
free(*origin);
line += 7;
- while(isspace((int)*line))
+ while(isspace((unsigned char)*line))
line++;
*origin = sldns_str2wire_dname(line, &len);
*origin_len = len;
/* not a comment, complete the keyword */
if(numdone > 0) {
/* check same type */
- if(isspace(c)) {
+ if(isspace((unsigned char)c)) {
ungetc(c, in);
return numdone;
}
}
sldns_buffer_write_u8(buf, (uint8_t)c);
numdone++;
- if(isspace(c)) {
+ if(isspace((unsigned char)c)) {
/* collate whitespace into ' ' */
while((c = getc(in)) != EOF ) {
if(c == '\n')
(*line)++;
- if(!isspace(c)) {
+ if(!isspace((unsigned char)c)) {
ungetc(c, in);
break;
}
int rdlen;
sldns_buffer_clear(buf);
while((rdlen=readkeyword_bindfile(in, buf, line, 1))) {
- if(rdlen == 1 && isspace((int)*sldns_buffer_begin(buf))) {
+ if(rdlen == 1 && isspace((unsigned char)*sldns_buffer_begin(buf))) {
sldns_buffer_clear(buf);
continue;
}
sldns_buffer_clear(buf);
while((rdlen=readkeyword_bindfile(in, buf, line, comments))) {
if(rdlen == 1 && sldns_buffer_position(buf) == 1
- && isspace((int)*sldns_buffer_begin(buf))) {
+ && isspace((unsigned char)*sldns_buffer_begin(buf))) {
/* starting whitespace is removed */
sldns_buffer_clear(buf);
continue;
}
return 1;
} else if(rdlen == 1 &&
- isspace((int)sldns_buffer_current(buf)[-1])) {
+ isspace((unsigned char)sldns_buffer_current(buf)[-1])) {
/* leave whitespace here */
} else {
/* not space or whatnot, so actual content */