if (*str == '.') break;
- c = memchr(tab, tolower((int) *str), base);
+ c = memchr(tab, tolower((uint8_t) *str), base);
if (!c) return 0;
rcode *= base;
p = format + 7;
if ((strlen(p) < 3) ||
- !isdigit((int) p[0]) ||
+ !isdigit((uint8_t) p[0]) ||
(p[1] != ',') ||
- !isdigit((int) p[2]) ||
+ !isdigit((uint8_t) p[2]) ||
(p[3] && (p[3] != ','))) {
fr_strerror_printf("dict_init: %s[%d]: Invalid format for VENDOR. Expected text like \"1,1\", got \"%s\"",
fn, line, p);
/*
* Validate all entries
*/
- if (!isdigit((int) argv[1][0])) {
+ if (!isdigit((uint8_t) argv[1][0])) {
fr_strerror_printf("dict_init: %s[%d]: invalid value",
fn, line);
return -1;
}
if (servname) {
- if (isdigit((int)*servname)) {
+ if (isdigit((uint8_t)*servname)) {
port = htons(atoi(servname));
} else {
struct servent *se;
num_id = 0;
if ((idx += 2) > 6)
return NULL;
- } else if ((pch = strchr(xdigits, tolower(*p))) != NULL) {
+ } else if ((pch = strchr(xdigits, tolower((uint8_t) *p))) != NULL) {
if (++num_id > 4)
return NULL;
/*
if (len > outlen) len = outlen;
for (i = 0; i < len; i++) {
- if(!(c1 = memchr(hextab, tolower((int) hex[i << 1]), sizeof(hextab))) ||
- !(c2 = memchr(hextab, tolower((int) hex[(i << 1) + 1]), sizeof(hextab))))
+ if(!(c1 = memchr(hextab, tolower((uint8_t) hex[i << 1]), sizeof(hextab))) ||
+ !(c2 = memchr(hextab, tolower((uint8_t) hex[(i << 1) + 1]), sizeof(hextab))))
break;
bin[i] = ((c1-hextab)<<4) + (c2-hextab);
}
bool is_whitespace(char const *value)
{
do {
- if (!isspace(*value)) return false;
+ if (!isspace((uint8_t) *value)) return false;
value++;
} while (*value);
{
#ifndef __clang_analyzer__
do {
- if (!isdigit(*value)) return false;
+ if (!isdigit((uint8_t) *value)) return false;
value++;
} while (*value);
* other functions doing similar things.
*/
#else
- if (!isdigit(*value)) return false;
+ if (!isdigit((uint8_t) *value)) return false;
#endif
return true;
* =
* value
*/
- if ((*p == ':') && (!isdigit((int) p[1]))) {
+ if ((*p == ':') && (!isdigit((uint8_t) p[1]))) {
break;
}
* Look for tag (:#). This is different from :=, which
* is an operator.
*/
- if ((*p == ':') && (isdigit((int) p[1]))) {
+ if ((*p == ':') && (isdigit((uint8_t) p[1]))) {
if (q >= (raw->l_opand + sizeof(raw->l_opand))) {
goto too_long;
}
*(q++) = *(p++);
- while (isdigit((int) *p)) {
+ while (isdigit((uint8_t) *p)) {
if (q >= (raw->l_opand + sizeof(raw->l_opand))) {
goto too_long;
}
PUT_CHAR('0', p); PUT_CHAR(*p->pf, p);
}
while (*tmp) { /* hexa */
- PUT_CHAR((*p->pf == 'X' ? toupper(*tmp) : *tmp), p);
+ PUT_CHAR((*p->pf == 'X' ? toupper((uint8_t) *tmp) : *tmp), p);
tmp++;
}
PAD_LEFT(p);
case '1': case '2': case '3':
case '4': case '5': case '6':
case '7': case '8': case '9': /* gob all the digits */
- for (i = 0; isdigit(*s); i++, s++)
+ for (i = 0; isdigit((uint8_t) *s); i++, s++)
if (i < MAX_FIELD/2 - 1)
number[i] = *s;
number[i] = '\0';
/* Skip whitespace */
p = *ptr;
- while (*p && isspace((int) *p)) p++;
+ while (*p && isspace((uint8_t) *p)) p++;
if (!*p) {
*ptr = p;
* comma.
*/
if (!quote) {
- if (isspace((int) *p)) {
+ if (isspace((uint8_t) *p)) {
break;
}
done:
/* Skip whitespace again. */
- while (*p && isspace((int) *p)) p++;
+ while (*p && isspace((uint8_t) *p)) p++;
*ptr = p;
p = *ptr;
- while (*p && (isspace((int)*p))) p++;
+ while (*p && (isspace((uint8_t)*p))) p++;
*ptr = p;
while (*cp) {
if (cp[1] == ':') {
c1 = hextab;
- c2 = memchr(hextab, tolower((int) cp[0]), 16);
+ c2 = memchr(hextab, tolower((uint8_t) cp[0]), 16);
cp += 2;
} else if ((cp[1] != '\0') && ((cp[2] == ':') || (cp[2] == '\0'))) {
- c1 = memchr(hextab, tolower((int) cp[0]), 16);
- c2 = memchr(hextab, tolower((int) cp[1]), 16);
+ c1 = memchr(hextab, tolower((uint8_t) cp[0]), 16);
+ c2 = memchr(hextab, tolower((uint8_t) cp[1]), 16);
cp += 2;
if (*cp == ':') cp++;
} else {
* Check for valid characters
*/
for (p = dp->d_name; *p != '\0'; p++) {
- if (isalpha((int)*p) ||
- isdigit((int)*p) ||
+ if (isalpha((uint8_t)*p) ||
+ isdigit((uint8_t)*p) ||
(*p == ':') ||
(*p == '.')) continue;
break;
#define INIT_STATS(_ti, _v) do {\
strlcpy(buffer, fr_packet_codes[code], sizeof(buffer)); \
- for (p = buffer; *p; ++p) *p = tolower(*p);\
+ for (p = buffer; *p; ++p) *p = tolower((uint8_t) *p);\
last = *tmpl = rs_stats_collectd_init(ctx, conf, type, _ti, buffer, stats, _v);\
if (!*tmpl) {\
TALLOC_FREE(*out);\
return NULL;
}
- if (isdigit(*argv[1])) {
+ if (isdigit((uint8_t) *argv[1])) {
if (ip_hton(&ipaddr, AF_UNSPEC, argv[0], false) < 0) {
cprintf_error(listener, "Failed parsing IP address; %s\n",
fr_strerror());
if (has_spaces) {
ptr = cbuf;
- while (isspace((int) *ptr)) ptr++;
+ while (isspace((uint8_t) *ptr)) ptr++;
if (ptr > cbuf) {
memmove(cbuf, ptr, len - (ptr - cbuf));
if (at_eof) break;
ptr = buf;
- while (*ptr && isspace((int) *ptr)) ptr++;
+ while (*ptr && isspace((uint8_t) *ptr)) ptr++;
if (!*ptr || (*ptr == '#')) continue;
* Check for valid characters
*/
for (p = dp->d_name; *p != '\0'; p++) {
- if (isalpha((int)*p) ||
- isdigit((int)*p) ||
+ if (isalpha((uint8_t)*p) ||
+ isdigit((uint8_t)*p) ||
(*p == '-') ||
(*p == '_') ||
(*p == '.')) continue;
case T_OP_EQ:
case T_OP_SET:
case T_OP_PREPEND:
- while (isspace((int) *ptr)) ptr++;
+ while (isspace((uint8_t) *ptr)) ptr++;
/*
* Be a little more forgiving.
t3 = T_BARE_WORD;
while (*q && (*q >= ' ') && (*q != ',') &&
- !isspace(*q)) q++;
+ !isspace((uint8_t) *q)) q++;
if ((size_t) (q - ptr) >= sizeof(buf3)) {
ERROR("%s[%d]: Parse error: value too long",
/*
* Require a comma, unless there's a comment.
*/
- while (isspace(*ptr)) ptr++;
+ while (isspace((uint8_t) *ptr)) ptr++;
if (*ptr == ',') {
ptr++;
/*
* Done parsing one thing. Skip to EOL if possible.
*/
- while (isspace(*ptr)) ptr++;
+ while (isspace((uint8_t) *ptr)) ptr++;
if (*ptr == '#') continue;
if (*p == '-') p++;
- while (isdigit((int) *p)) p++;
+ while (isdigit((uint8_t) *p)) p++;
return (*p == '\0');
}
for (p = buffer; *p != '='; p++) {
if (*p == '-') {
*p = '_';
- } else if (isalpha((int) *p)) {
- *p = toupper(*p);
+ } else if (isalpha((uint8_t) *p)) {
+ *p = toupper((uint8_t) *p);
}
}
}
* ignore it.
*/
ptr = buffer;
- while (isspace((int) *ptr)) ptr++;
+ while (isspace((uint8_t) *ptr)) ptr++;
if (*ptr == '#' || *ptr == '\n' || !*ptr) continue;
/*
* The user's name MUST be the first text on the line.
*/
- if (isspace((int) buffer[0])) {
+ if (isspace((uint8_t) buffer[0])) {
ERROR("%s[%d]: Entry does not begin with a user name",
file, lineno);
fclose(fp);
* $INCLUDE filename
*/
if (strcasecmp(entry, "$INCLUDE") == 0) {
- while (isspace((int) *ptr)) ptr++;
+ while (isspace((uint8_t) *ptr)) ptr++;
/*
* If it's an absolute pathname,
* We COULD have a reply, OR we could have a new entry.
*/
if (mode == FIND_MODE_WANT_REPLY) {
- if (!isspace((int) buffer[0])) goto create_entry;
+ if (!isspace((uint8_t) buffer[0])) goto create_entry;
mode = FIND_MODE_HAVE_REPLY;
}
* The previous line ended with a comma, and then
* we have the start of a new entry!
*/
- if (!isspace((int) buffer[0])) {
+ if (!isspace((uint8_t) buffer[0])) {
trailing_comma:
pairlist_free(&pl);
talloc_free(check_tmp);
*/
mode = FIND_MODE_NAME;
if (feof(fp)) break;
- if (!isspace((int) buffer[0])) goto parse_again;
+ if (!isspace((uint8_t) buffer[0])) goto parse_again;
}
/*
* string, go parse it as that.
*/
if (rhs_type != T_BARE_WORD) return false;
- if ((rhs[0] != '0') || (tolower((int)rhs[1]) != 'x')) return false;
+ if ((rhs[0] != '0') || (tolower((uint8_t)rhs[1]) != 'x')) return false;
if (!rhs[2]) return false;
len = strlen(rhs + 2);
/*
* Spaces or special characters delineate the word
*/
- if (isspace((int) *p) || (*p == '&') || (*p == '|') ||
+ if (isspace((uint8_t) *p) || (*p == '&') || (*p == '|') ||
(*p == '!') || (*p == '=') || (*p == '<') || (*p == '>')) {
break;
}
char const *q;
PW_TYPE cast;
- while (isspace((int) *p)) p++; /* skip spaces before condition */
+ while (isspace((uint8_t) *p)) p++; /* skip spaces before condition */
if (*p != '<') return 0;
p++;
q++;
- while (isspace((int) *q)) q++; /* skip spaces after cast */
+ while (isspace((uint8_t) *q)) q++; /* skip spaces after cast */
return q - start;
}
lhs = rhs = NULL;
lhs_type = rhs_type = T_INVALID;
- while (isspace((int) *p)) p++; /* skip spaces before condition */
+ while (isspace((uint8_t) *p)) p++; /* skip spaces before condition */
if (!*p) {
return_P("Empty condition is invalid");
if (*p == '!') {
p++;
c->negate = true;
- while (isspace((int) *p)) p++; /* skip spaces after negation */
+ while (isspace((uint8_t) *p)) p++; /* skip spaces after negation */
/*
* Just for stupidity
}
p += slen;
- while (isspace((int) *p)) p++; /* skip spaces after (COND)*/
+ while (isspace((uint8_t) *p)) p++; /* skip spaces after (COND)*/
} else { /* it's a bare FOO==BAR */
/*
c->cast = dict_attrbyvalue(PW_CAST_BASE + PW_TYPE_OCTETS, 0);
}
- while (isspace((int)*p)) p++; /* skip spaces after LHS */
+ while (isspace((uint8_t)*p)) p++; /* skip spaces after LHS */
/*
* We may (or not) have an operator
break;
}
- while (isspace((int) *p)) p++; /* skip spaces after operator */
+ while (isspace((uint8_t) *p)) p++; /* skip spaces after operator */
if (!*p) {
return_P("Expected text after operator");
keep_going:
p += slen;
- while (isspace((int) *p)) p++; /* skip spaces after RHS */
+ while (isspace((uint8_t) *p)) p++; /* skip spaces after RHS */
} /* parse OP RHS */
} /* parse a condition (COND) or FOO OP BAR*/
}
p++;
- while (isspace((int) *p)) p++; /* skip spaces after closing brace */
+ while (isspace((uint8_t) *p)) p++; /* skip spaces after closing brace */
goto done;
}
for (q = c->data.vpt->name;
*q != '\0';
q++) {
- if (!isdigit((int) *q)) {
+ if (!isdigit((uint8_t) *q)) {
break;
}
if (*q != '0') zeros = false;
*p = '\0';
p = buffer + 1;
- while (isspace((int) *p)) p++;
+ while (isspace((uint8_t) *p)) p++;
length = encode_tlv(p, output, outlen);
if (length == 0) return 0;
while (*p) {
char *c1, *c2;
- while (isspace((int) *p)) p++;
+ while (isspace((uint8_t) *p)) p++;
if (!*p) break;
- if(!(c1 = memchr(hextab, tolower((int) p[0]), 16)) ||
- !(c2 = memchr(hextab, tolower((int) p[1]), 16))) {
+ if(!(c1 = memchr(hextab, tolower((uint8_t) p[0]), 16)) ||
+ !(c2 = memchr(hextab, tolower((uint8_t) p[1]), 16))) {
fprintf(stderr, "Invalid data starting at "
"\"%s\"\n", p);
return 0;
{
int length;
- if (!isspace((int) *p)) {
+ if (!isspace((uint8_t) *p)) {
fprintf(stderr, "Invalid character following attribute "
"definition\n");
return 0;
}
- while (isspace((int) *p)) p++;
+ while (isspace((uint8_t) *p)) p++;
if (*p == '{') {
int sublen;
length = 0;
do {
- while (isspace((int) *p)) p++;
+ while (isspace((uint8_t) *p)) p++;
if (!*p) {
if (length == 0) {
fprintf(stderr, "No data\n");
((p > buffer) && (p[-1] != '[')))) *p = '\0';
p = buffer;
- while (isspace((int) *p)) p++;
+ while (isspace((uint8_t) *p)) p++;
if (!*p) continue;
DEBUG2("%s[%d]: %s\n", filename, lineno, buffer);
char *q;
p += 9;
- while (isspace((int) *p)) p++;
+ while (isspace((uint8_t) *p)) p++;
q = strrchr(directory, '/');
if (q) {
break;
case 'c':
- if (!isdigit((int) *optarg)) usage();
+ if (!isdigit((uint8_t) *optarg)) usage();
resend_count = atoi(optarg);
break;
case 'r':
- if (!isdigit((int) *optarg)) usage();
+ if (!isdigit((uint8_t) *optarg)) usage();
retries = atoi(optarg);
if ((retries == 0) || (retries > 1000)) usage();
break;
break;
case 't':
- if (!isdigit((int) *optarg))
+ if (!isdigit((uint8_t) *optarg))
usage();
timeout = atof(optarg);
break;
/*
* Get the request type
*/
- if (!isdigit((int) argv[2][0])) {
+ if (!isdigit((uint8_t) argv[2][0])) {
packet_code = fr_str2int(request_types, argv[2], -2);
if (packet_code == -2) {
ERROR("Unrecognised request type \"%s\"", argv[2]);
}
p = fmt;
- while (isspace((int) *p)) p++;
+ while (isspace((uint8_t) *p)) p++;
/*
* Allow for dynamic strings as arguments.
* Check for valid characters
*/
for (p = dp->d_name; *p != '\0'; p++) {
- if (isalpha((int)*p) ||
- isdigit((int)*p) ||
+ if (isalpha((uint8_t)*p) ||
+ isdigit((uint8_t)*p) ||
(*p == '-') ||
(*p == '_') ||
(*p == '.')) continue;
if (!identity) return true;
while ((c = *(identity++)) != '\0') {
- if (isalpha((int) c) || isdigit((int) c) || isspace((int) c) ||
+ if (isalpha((uint8_t) c) || isdigit((uint8_t) c) || isspace((uint8_t) c) ||
(c == '@') || (c == '-') || (c == '_') || (c == '.')) {
continue;
}
{
char const *d = q + 1;
- if (isdigit((int) *d)) {
- while (isdigit((int) *d)) d++;
+ if (isdigit((uint8_t) *d)) {
+ while (isdigit((uint8_t) *d)) d++;
/*
* Char after the number string
* Ignore blank lines and comments
*/
p = input;
- while (isspace((int) *p)) p++;
+ while (isspace((uint8_t) *p)) p++;
if (*p < ' ') continue;
if (*p == '#') continue;
char const *concat;
char buffer[2];
- while (isspace((int) *fmt)) fmt++;
+ while (isspace((uint8_t) *fmt)) fmt++;
slen = tmpl_from_attr_substr(&vpt, fmt, REQUEST_CURRENT, PAIR_LIST_REQUEST, false, false);
if (slen <= 0) {
}
fmt += slen;
- while (isspace((int) *fmt)) fmt++;
+ while (isspace((uint8_t) *fmt)) fmt++;
if (!*fmt) {
concat = ",";
char const *fmt, char *out, size_t outlen)
{
VALUE_PAIR *vp;
- while (isspace((int) *fmt)) fmt++;
+ while (isspace((uint8_t) *fmt)) fmt++;
if ((radius_get_vp(&vp, request, fmt) < 0) || !vp) {
*out = '\0';
uint64_t int64 = 0; /* Needs to be initialised to zero */
uint32_t int32 = 0; /* Needs to be initialised to zero */
- while (isspace((int) *fmt)) fmt++;
+ while (isspace((uint8_t) *fmt)) fmt++;
if ((radius_get_vp(&vp, request, fmt) < 0) || !vp) {
*out = '\0';
value_data_t dst;
uint8_t const *buff = NULL;
- while (isspace((int) *fmt)) fmt++;
+ while (isspace((uint8_t) *fmt)) fmt++;
if ((radius_get_vp(&vp, request, fmt) < 0) || !vp) {
error:
{
VALUE_PAIR *vp;
- while (isspace((int) *fmt)) fmt++;
+ while (isspace((uint8_t) *fmt)) fmt++;
if ((radius_get_vp(&vp, request, fmt) < 0) || !vp) {
*out = '\0';
VALUE_PAIR *vp;
DICT_VENDOR *vendor;
- while (isspace((int) *fmt)) fmt++;
+ while (isspace((uint8_t) *fmt)) fmt++;
if ((radius_get_vp(&vp, request, fmt) < 0) || !vp) {
*out = '\0';
{
VALUE_PAIR *vp;
- while (isspace((int) *fmt)) fmt++;
+ while (isspace((uint8_t) *fmt)) fmt++;
if ((radius_get_vp(&vp, request, fmt) < 0) || !vp) {
*out = '\0';
{
VALUE_PAIR *vp;
- while (isspace((int) *fmt)) fmt++;
+ while (isspace((uint8_t) *fmt)) fmt++;
if ((radius_get_vp(&vp, request, fmt) < 0) || !vp) {
*out = '\0';
{
VALUE_PAIR *vp;
- while (isspace((int) *fmt)) fmt++;
+ while (isspace((uint8_t) *fmt)) fmt++;
if ((radius_get_vp(&vp, request, fmt) < 0) || !vp) {
*out = '\0';
return -1;
}
- while (isspace((int) *fmt)) fmt++;
+ while (isspace((uint8_t) *fmt)) fmt++;
if (tmpl_from_attr_str(&vpt, fmt, REQUEST_CURRENT, PAIR_LIST_REQUEST, false, false) <= 0) {
RDEBUG("%s", fr_strerror());
VALUE_PAIR *vp;
uint8_t const *p;
- while (isspace((int) *fmt)) fmt++;
+ while (isspace((uint8_t) *fmt)) fmt++;
if (outlen < 3) {
nothing:
{
VALUE_PAIR *vp;
- while (isspace((int) *fmt)) fmt++;
+ while (isspace((uint8_t) *fmt)) fmt++;
if (outlen < 3) {
nothing:
{
VALUE_PAIR *vp;
- while (isspace((int) *fmt)) fmt++;
+ while (isspace((uint8_t) *fmt)) fmt++;
if (fmt[0] == '&') {
if ((radius_get_vp(&vp, request, fmt) < 0) || !vp) {
for (q = p; *q != '\0'; q++) {
if (*q == ':') break;
- if (isspace((int) *q)) break;
+ if (isspace((uint8_t) *q)) break;
if (*q == '[') continue;
break;
#endif
case 'r':
- if (!isdigit((int) *optarg))
+ if (!isdigit((uint8_t) *optarg))
usage();
retries = atoi(optarg);
if ((retries == 0) || (retries > 1000)) usage();
break;
case 't':
- if (!isdigit((int) *optarg))
+ if (!isdigit((uint8_t) *optarg))
usage();
timeout = atof(optarg);
break;
* See what kind of request we want to send.
*/
if (argc >= 3) {
- if (!isdigit((int) argv[2][0])) {
+ if (!isdigit((uint8_t) argv[2][0])) {
packet_code = fr_str2int(request_types, argv[2], -2);
if (packet_code == -2) {
fprintf(stderr, "Unknown packet type: %s\n", argv[2]);
int decoded = 0;
ssize_t slen;
- while (isspace((int) *fmt)) fmt++;
+ while (isspace((uint8_t) *fmt)) fmt++;
slen = tmpl_from_attr_str(&src, fmt, REQUEST_CURRENT, PAIR_LIST_REQUEST, false, false);
if (slen <= 0) {
uint8_t *p = binbuf, *end = p + sizeof(binbuf);
ssize_t slen;
- while (isspace((int) *fmt)) fmt++;
+ while (isspace((uint8_t) *fmt)) fmt++;
if ((radius_copy_vp(request, &head, request, fmt) < 0) || !head) {
*out = '\0';
if (!inst->reset)
return -1;
- if (isdigit((int) inst->reset[0])) {
+ if (isdigit((uint8_t) inst->reset[0])) {
len = strlen(inst->reset);
if (len == 0)
return -1;
last = inst->reset[len - 1];
- if (!isalpha((int) last))
+ if (!isalpha((uint8_t) last))
last = 'd';
num = atoi(inst->reset);
DEBUG("rlm_counter: num=%d, last=%c",num,last);
*/
p = mod_name;
while (*p) {
- *p = tolower(*p);
+ *p = tolower((uint8_t) *p);
p++;
}
break;
case 'r':
- if (!isdigit((int) *optarg))
+ if (!isdigit((uint8_t) *optarg))
usage();
retries = atoi(optarg);
break;
do_summary = 1;
break;
case 't':
- if (!isdigit((int) *optarg))
+ if (!isdigit((uint8_t) *optarg))
usage();
timeout = atof(optarg);
break;
/*
* Get the request type
*/
- if (!isdigit((int) argv[2][0])) {
+ if (!isdigit((uint8_t) argv[2][0])) {
packet_code = fr_str2int(rc_request_types, argv[2], -2);
if (packet_code == -2) {
ERROR("Unrecognised request type \"%s\"\n", argv[2]);
/*
* Look for a number.
*/
- while (isspace((int) *p)) p++;
+ while (isspace((uint8_t) *p)) p++;
/*
* ~1 == 0xff...ffe
goto done;
}
- while (isspace((int) *p)) p++;
+ while (isspace((uint8_t) *p)) p++;
if ((*p < '0') || (*p > '9')) {
RDEBUG2("Not a number at \"%s\"", p);
if (!get_number(request, &p, &lhs)) return false;
redo:
- while (isspace((int) *p)) p++;
+ while (isspace((uint8_t) *p)) p++;
/*
* A number by itself is OK.
* But we limit it to 100, because we don't want
* utter stupidity.
*/
- while (isdigit((int) *p)) {
+ while (isdigit((uint8_t) *p)) {
if (number >= 100) {
p++;
continue;
/* Is a % char */
/* Don't need \0 check, as it won't be in the hextab */
- if (!(c1 = memchr(hextab, tolower(*++p), 16)) ||
- !(c2 = memchr(hextab, tolower(*++p), 16))) {
+ if (!(c1 = memchr(hextab, tolower((uint8_t) *++p), 16)) ||
+ !(c2 = memchr(hextab, tolower((uint8_t) *++p), 16))) {
REMARKER(fmt, p - fmt, "None hex char in % sequence");
return -1;
}
/* Is a = char */
- if (!(c1 = memchr(hextab, tolower(*(p + 1)), 16)) ||
- !(c2 = memchr(hextab, tolower(*(p + 2)), 16))) goto next;
+ if (!(c1 = memchr(hextab, tolower((uint8_t) *(p + 1)), 16)) ||
+ !(c2 = memchr(hextab, tolower((uint8_t) *(p + 2)), 16))) goto next;
c3 = ((c1 - hextab) << 4) + (c2 - hextab);
*out++ = c3;
for (p = fmt, q = out; *p != '\0'; p++, outlen--) {
if (outlen <= 1) break;
- *(q++) = tolower((int) *p);
+ *(q++) = tolower((uint8_t) *p);
}
*q = '\0';
for (p = fmt, q = out; *p != '\0'; p++, outlen--) {
if (outlen <= 1) break;
- *(q++) = toupper((int) *p);
+ *(q++) = toupper((uint8_t) *p);
}
*q = '\0';
data_len = xlat_fmt_to_ref(&data, request, data_ref);
if (data_len < 0) return -1;
- while (isspace(*p) && p++);
+ while (isspace((uint8_t) *p) && p++);
key_len = xlat_fmt_to_ref(&key, request, p);
if (key_len < 0) return -1;
data_len = xlat_fmt_to_ref(&data, request, data_ref);
if (data_len < 0) return -1;
- while (isspace(*p) && p++);
+ while (isspace((uint8_t) *p) && p++);
key_len = xlat_fmt_to_ref(&key, request, p);
if (key_len < 0) return -1;
/*
* Trim whitespace
*/
- while (isspace(*p) && p++);
+ while (isspace((uint8_t) *p) && p++);
slen = tmpl_from_attr_substr(&vpt, p, REQUEST_CURRENT, PAIR_LIST_REQUEST, false, false);
if (slen <= 0) {
*fill = ' '; /* the default */
p = fmt;
- while (isspace((int) *p)) p++;
+ while (isspace((uint8_t) *p)) p++;
if (*p != '&') {
RDEBUG("First argument must be an attribute reference");
p = fmt + slen;
- while (isspace((int) *p)) p++;
+ while (isspace((uint8_t) *p)) p++;
length = strtoul(p, &end, 10);
if ((length == ULONG_MAX) || (length > 8192)) {
* and we must have only ONE fill character.
*/
if (*p) {
- if (!isspace(*p)) {
+ if (!isspace((uint8_t) *p)) {
talloc_free(vpt);
RDEBUG("Invalid text found at: %s", p);
return false;
}
- while (isspace((int) *p)) p++;
+ while (isspace((uint8_t) *p)) p++;
if (p[1] != '\0') {
talloc_free(vpt);
p = fmt;
- while (isspace((int) *p)) p++;
+ while (isspace((uint8_t) *p)) p++;
if (*p == '\0') return -1;
while (*p) {
- while (isspace((int) *p)) p++;
+ while (isspace((uint8_t) *p)) p++;
if (*p == '\0') break;
/* Jump forward to next attr */
p += slen;
- if (*p != '\0' && !isspace((int)*p)) {
+ if (*p != '\0' && !isspace((uint8_t)*p)) {
REMARKER(fmt, (p - fmt), "Missing whitespace");
goto error;
}
case ',':
case ';':
case ' ':
- while (isspace((int) *p)) p++;
+ while (isspace((uint8_t) *p)) p++;
if (p == q) continue;
buff = talloc_array(inst, char, (q - p) + 1);
end = -1;
if ((p = strchr(tm, '-')) != NULL) {
p++;
- if (p - tm != 5 || strlen(p) < 4 || !isdigit((int) *p))
+ if (p - tm != 5 || strlen(p) < 4 || !isdigit((uint8_t) *p))
return 0;
end = 600 * val(p[0]) + 60 * val(p[1]) + atoi(p + 2);
}
start = 0;
end = DAYMIN - 1;
} else {
- if (strlen(tm) < 4 || !isdigit((int) *tm))
+ if (strlen(tm) < 4 || !isdigit((uint8_t) *tm))
return 0;
start = 600 * val(tm[0]) + 60 * val(tm[1]) + atoi(tm + 2);
if (end < 0) end = start;
int start, end;
for (hr = tm; *hr; hr++)
- if (isdigit((int) *hr))
+ if (isdigit((uint8_t) *hr))
break;
if (hr == tm)
tm = "Al";
strlcpy(tmp, tm, sizeof(tmp));
for (s = tmp; *s; s++)
- if (isupper(*s)) *s = tolower(*s);
+ if (isupper((uint8_t) *s)) *s = tolower((uint8_t) *s);
s = strtok(tmp, ",|");
while (s) {
if ((*p == '\0') || (outlen <= 32))
return 0;
- while (isspace(*p)) p++;
+ while (isspace((uint8_t) *p)) p++;
if (mschap_ntpwdhash(buffer, p) < 0) {
REDEBUG("Failed generating NT-Password");
if ((*p == '\0') || (outlen <= 32))
return 0;
- while (isspace(*p)) p++;
+ while (isspace((uint8_t) *p)) p++;
smbdes_lmpwdhash(p, buffer);
fr_bin2hex(out, buffer, LM_DIGEST_LENGTH);
memset(p14, 0, sizeof(p14));
for (i = 0; i < 14 && password[i]; i++) {
- p14[i] = toupper((int) password[i]);
+ p14[i] = toupper((uint8_t) password[i]);
}
smbhash(lmhash, sp8, p14);
/*
* Empty response?
*/
- while (isspace(*p)) p++;
+ while (isspace((uint8_t) *p)) p++;
if (*p == '\0') return 0;
while (((q = strchr(p, '=')) != NULL) && (count < REST_BODY_MAX_ATTRS)) {
/*
* Empty response?
*/
- while (isspace(*p)) p++;
+ while (isspace((uint8_t) *p)) p++;
if (*p == '\0') return 0;
json = json_tokener_parse(p);
/*
* Trim whitespace
*/
- while (isspace(*p) && p++);
+ while (isspace((uint8_t) *p) && p++);
/*
* Unescape parts of xlat'd URI, this allows REST servers to be specified by
* We parse the string to see what's up.
*/
p = query;
- while (isspace((int) *p)) p++;
+ while (isspace((uint8_t) *p)) p++;
if (strncmp(p, "db.", 3) != 0) {
ERROR("rlm_sql_mongo: Invalid query - must start with 'db.'");
* Allow whitespace after the command name, and
* before the bracket.
*/
- if (isspace((int) *p)) {
+ if (isspace((uint8_t) *p)) {
*ptr = '\0';
- while (*p && isspace((int) *p)) p++;
+ while (*p && isspace((uint8_t) *p)) p++;
if (*p != '(') {
ERROR("rlm_sql_mongo: Invalid query - no starting '('");
return -1;
}
- while (isspace((int) *p)) p++;
+ while (isspace((uint8_t) *p)) p++;
if ((strncasecmp(p, "insert", 6) == 0) ||
(strncasecmp(p, "update", 6) == 0) ||
/*
* Reset every N hours, days, weeks, months.
*/
- if (isdigit((int) inst->reset[0])){
+ if (isdigit((uint8_t) inst->reset[0])){
len = strlen(inst->reset);
if (len == 0) return -1;
last = inst->reset[len - 1];
- if (!isalpha((int) last)) {
+ if (!isalpha((uint8_t) last)) {
last = 'd';
}
rad_assert(inst->reset != NULL);
- if (isdigit((int) inst->reset[0])){
+ if (isdigit((uint8_t) inst->reset[0])){
len = strlen(inst->reset);
if (len == 0)
return -1;
last = inst->reset[len - 1];
- if (!isalpha((int) last))
+ if (!isalpha((uint8_t) last))
last = 'd';
num = atoi(inst->reset);
DEBUG("rlm_sqlcounter: num=%d, last=%c",num,last);
strlcpy(buffer, fmt, sizeof(buffer));
p = buffer;
- while (isspace((int) *p)) p++; /* skip leading spaces */
+ while (isspace((uint8_t) *p)) p++; /* skip leading spaces */
data_name = p;
- while (*p && !isspace((int) *p)) p++;
+ while (*p && !isspace((uint8_t) *p)) p++;
if (!*p) {
error:
return -1;
}
- while (isspace((int) *p)) *(p++) = '\0';
+ while (isspace((uint8_t) *p)) *(p++) = '\0';
if (!*p) GOTO_ERROR;
data_size = p;
- while (*p && !isspace((int) *p)) p++;
+ while (*p && !isspace((uint8_t) *p)) p++;
if (!*p) GOTO_ERROR;
- while (isspace((int) *p)) *(p++) = '\0';
+ while (isspace((uint8_t) *p)) *(p++) = '\0';
if (!*p) GOTO_ERROR;
data_type = p;
- while (*p && !isspace((int) *p)) p++;
+ while (*p && !isspace((uint8_t) *p)) p++;
if (*p) GOTO_ERROR; /* anything after the type is an error */
/*
/*
* Trim whitespace
*/
- while (isspace(*p) && p++);
+ while (isspace((uint8_t) *p) && p++);
/*
* Find numeric parameters at the end.
if (modhex[(i << 1) + 1] == '\0')
return -1;
- if (!(c1 = memchr(modhextab, tolower((int) modhex[i << 1]), 16)) ||
- !(c2 = memchr(modhextab, tolower((int) modhex[(i << 1) + 1]), 16)))
+ if (!(c1 = memchr(modhextab, tolower((uint8_t) modhex[i << 1]), 16)) ||
+ !(c2 = memchr(modhextab, tolower((uint8_t) modhex[(i << 1) + 1]), 16)))
return -1;
hex[i] = hextab[c1 - modhextab];