Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion base32hex.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ decode_base32hex(void *dest, char *src, size_t dstsize)
v = *src - 'a' + 10;
else if (*src >= '0' && *src <= '9')
v = *src - '0';
else if (isspace(*src) || *src == '=') {
else if (isspace((unsigned char)*src) || *src == '=') {
src++;
continue;
} else {
Expand Down
2 changes: 1 addition & 1 deletion base64.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ decode_base64(void *dest, char *src, size_t dstsize)
v = 62;
else if (*src == '/')
v = 63;
else if (isspace(*src) || *src == '=') {
else if (isspace((unsigned char)*src) || *src == '=') {
src++;
continue;
} else {
Expand Down
2 changes: 1 addition & 1 deletion carp.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ static char proggy[MAXPATHLEN];

const char *thisprogname(void)
{
#if defined(__FreeBSD__)
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
return getprogname();
#elif defined(__APPLE__)
return getprogname();
Expand Down
4 changes: 2 additions & 2 deletions cert.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ static int extract_certificate_type(char **s, char *what)
int type;
char *str_type;

if (isdigit(**s)) {
if (isdigit((unsigned char)**s)) {
type = extract_integer(s, what, NULL);
if (type >= 1 && type <= 8)
return type;
Expand Down Expand Up @@ -90,7 +90,7 @@ static struct rr* cert_parse(char *name, long ttl, int type, char *s)
return bitch("bad key tag");
rr->key_tag = key_tag;

if (isdigit(*s)) {
if (isdigit((unsigned char)*s)) {
alg = extract_integer(&s, "algorithm", NULL);
if (alg < 0) return NULL;
if (alg > 255) return bitch("bad algorithm");
Expand Down
12 changes: 6 additions & 6 deletions loc.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,15 @@ static struct rr *loc_parse(char *name, long ttl, int type, char *s)
deg = i;
min = 0;
sec = 0;
if (isdigit(*s)) {
if (isdigit((unsigned char)*s)) {
i = extract_integer(&s, "minutes latitude", NULL);
if (i < 0)
return NULL;
if (i > 59)
return bitch("minutes latitude not in the range 0..59");
min = i;

if (isdigit(*s)) { /* restricted floating point, starting with a digit */
if (isdigit((unsigned char)*s)) { /* restricted floating point, starting with a digit */
if (extract_double(&s, "seconds latitude", &sec, 0) < 0)
return NULL;
if (sec < 0 || sec > 59.999)
Expand All @@ -89,7 +89,7 @@ static struct rr *loc_parse(char *name, long ttl, int type, char *s)
} else {
return bitch("latitude: N or S is expected");
}
if (*s && !isspace(*s) && *s != ';' && *s != ')') {
if (*s && !isspace((unsigned char)*s) && *s != ';' && *s != ')') {
return bitch("latitude: N or S is expected");
}
s = skip_white_space(s);
Expand All @@ -104,15 +104,15 @@ static struct rr *loc_parse(char *name, long ttl, int type, char *s)
deg = i;
min = 0;
sec = 0;
if (isdigit(*s)) {
if (isdigit((unsigned char)*s)) {
i = extract_integer(&s, "minutes longitude", NULL);
if (i < 0)
return NULL;
if (i > 59)
return bitch("minutes longitude not in the range 0..59");
min = i;

if (isdigit(*s)) { /* restricted floating point, starting with a digit */
if (isdigit((unsigned char)*s)) { /* restricted floating point, starting with a digit */
if (extract_double(&s, "seconds longitude", &sec, 0) < 0)
return NULL;
if (sec < 0 || sec > 59.999)
Expand All @@ -129,7 +129,7 @@ static struct rr *loc_parse(char *name, long ttl, int type, char *s)
} else {
return bitch("longitude: E or W is expected");
}
if (*s && !isspace(*s) && *s != ';' && *s != ')') {
if (*s && !isspace((unsigned char)*s) && *s != ';' && *s != ')') {
return bitch("longitude: E or W is expected");
}
s = skip_white_space(s);
Expand Down
26 changes: 13 additions & 13 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ static char *process_directive(char *s)
if (*(s+1) == 'O' && strncmp(s, "$ORIGIN", 7) == 0) {
char *o;
s += 7;
if (!isspace(*s)) {
if (isalnum(*s)) goto unrecognized_directive;
if (!isspace((unsigned char)*s)) {
if (isalnum((unsigned char)*s)) goto unrecognized_directive;
return bitch("bad $ORIGIN format");
}
s = skip_white_space(s);
Expand All @@ -128,8 +128,8 @@ static char *process_directive(char *s)
}
} else if (*(s+1) == 'T' && strncmp(s, "$TTL", 4) == 0) {
s += 4;
if (!isspace(*s)) {
if (isalnum(*s)) goto unrecognized_directive;
if (!isspace((unsigned char)*s)) {
if (isalnum((unsigned char)*s)) goto unrecognized_directive;
return bitch("bad $TTL format");
}
s = skip_white_space(s);
Expand All @@ -149,8 +149,8 @@ static char *process_directive(char *s)
char *lhs, *rdtype;

s += 9;
if (!isspace(*s)) {
if (isalnum(*s)) goto unrecognized_directive;
if (!isspace((unsigned char)*s)) {
if (isalnum((unsigned char)*s)) goto unrecognized_directive;
return bitch("bad $GENERATE format");
}
s = skip_white_space(s);
Expand Down Expand Up @@ -190,13 +190,13 @@ static char *process_directive(char *s)
char *p, *f;
char c;
s += 8;
if (!isspace(*s)) {
if (isalnum(*s)) goto unrecognized_directive;
if (!isspace((unsigned char)*s)) {
if (isalnum((unsigned char)*s)) goto unrecognized_directive;
return bitch("bad $INCLUDE format");
}
s = skip_white_space(s);
p = s;
while (*s && !isspace(*s) && *s != ';')
while (*s && !isspace((unsigned char)*s) && *s != ';')
s++;
c = *s;
*s = '\0';
Expand All @@ -221,7 +221,7 @@ static char *process_directive(char *s)
} else {
unrecognized_directive:
s = d-1;
while (isalnum(*d)) d++;
while (isalnum((unsigned char)*d)) d++;
*d = '\0';
return bitch("unrecognized directive: %s", s);
}
Expand Down Expand Up @@ -276,7 +276,7 @@ read_zone_file(void)
continue;

s = file_info->buf;
if (!isspace(*s)) {
if (!isspace((unsigned char)*s)) {
/* <domain-name>, $INCLUDE, $ORIGIN */
if (*s == '$') {
process_directive(s);
Expand All @@ -298,7 +298,7 @@ read_zone_file(void)
}
if (G.default_ttl >= 0)
ttl = G.default_ttl;
if (isdigit(*s)) {
if (isdigit((unsigned char)*s)) {
ttl = extract_timevalue(&s, "TTL");
if (ttl < 0)
continue;
Expand All @@ -323,7 +323,7 @@ read_zone_file(void)
if (!class)
continue;
if (*class == 'i' && *(class+1) == 'n' && *(class+2) == 0) {
if (isdigit(*s)) {
if (isdigit((unsigned char)*s)) {
ttl = extract_timevalue(&s, "TTL");
if (ttl < 0)
continue;
Expand Down
2 changes: 1 addition & 1 deletion naptr.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ static struct rr *naptr_parse(char *name, long ttl, int type, char *s)
if (text.length < 0)
return NULL;
for (i = 0; i < text.length; i++) {
if (!isalnum(text.data[i])) {
if (!isalnum((unsigned char)text.data[i])) {
return bitch("flags contains illegal characters");
}
}
Expand Down
2 changes: 1 addition & 1 deletion nsec.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ void validate_nsec_chain(void)
freeall_temp();
s = rr->next_domain;
t = name;
while (*s) *t++ = tolower(*s++);
while (*s) *t++ = tolower((unsigned char)*s++);
*t = 0;
rr_set = find_rr_set(T_NSEC, name);
if (!rr_set) {
Expand Down
2 changes: 1 addition & 1 deletion nsec3.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ static struct rr* nsec3_parse(char *name, long ttl, int type, char *s)
rr->salt.length = 0;
rr->salt.data = NULL;
s++;
if (*s && !isspace(*s) && *s != ';' && *s != ')')
if (*s && !isspace((unsigned char)*s) && *s != ';' && *s != ')')
return bitch("salt is not valid");
s = skip_white_space(s);
} else {
Expand Down
2 changes: 1 addition & 1 deletion nsec3param.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ static struct rr* nsec3param_parse(char *name, long ttl, int type, char *s)
rr->salt.length = 0;
rr->salt.data = NULL;
s++;
if (*s && !isspace(*s) && *s != ';' && *s != ')')
if (*s && !isspace((unsigned char)*s) && *s != ';' && *s != ')')
return bitch("salt is not valid");
s = skip_white_space(s);
} else {
Expand Down
4 changes: 2 additions & 2 deletions rr.c
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ struct rr *rr_parse_any(char *name, long ttl, int type, char *s)
}
if (*s++ != '#')
goto invalid;
if (*s && !isspace(*s) && *s != ';' && *s != ')')
if (*s && !isspace((unsigned char)*s) && *s != ';' && *s != ')')
goto invalid;
s = skip_white_space(s);
if (!s) return NULL;
Expand Down Expand Up @@ -841,7 +841,7 @@ int extract_algorithm(char **s, char *what)
int alg;
char *str_alg;

if (isdigit(**s)) {
if (isdigit((unsigned char)**s)) {
alg = extract_integer(s, what, NULL);
if (algorithm_type(alg) == ALG_UNSUPPORTED) {
bitch("bad or unsupported algorithm %d", alg);
Expand Down
Loading