void *handle;
p = path;
- while (isspace((int) *p)) p++; /* GNU make is fanatical about spaces */
+ while (isspace((uint8_t) *p)) p++; /* GNU make is fanatical about spaces */
len = strlen(p);
if ((len + 1 + namelen + 1) > PATH_MAX) return NULL;
if (!lib) return NULL;
p = argv[1];
- while (isspace((int) *p)) p++;
+ while (isspace((uint8_t) *p)) p++;
symbol = dlsym(lib->handle, p);
if (!symbol) return NULL;
*p = '\0'; /* gets strcmp'd later */
for (p = def->name + 5; *p != '\0'; p++) {
- if (islower((int) *p)) {
- *p = toupper((int) *p);
+ if (islower((uint8_t) *p)) {
+ *p = toupper((uint8_t) *p);
} else if ((*p == '/') || (*p == '.')) {
*p = '_';
p = strstr(old, value);
if (p) {
- if (!p[value_len] || isspace((int) p[value_len])) {
+ if (!p[value_len] || isspace((uint8_t) p[value_len])) {
gmk_free(old);
return;
}
* Get the symbol name
*/
name = argv[0];
- while (isspace((int) *name)) name++;
+ while (isspace((uint8_t) *name)) name++;
DEBUG("Searching for symbol %s", name);
*/
p = argv[i];
while (p < r) {
- while (isspace((int) *p)) p++;
+ while (isspace((uint8_t) *p)) p++;
if ((p[0] == '-') && (p[1] == 'L')) {
has_dash_l = true;
* -L /path/to/foo is OK
*/
q = p + 2;
- while (isspace((int) *q)) q++;
+ while (isspace((uint8_t) *q)) q++;
/*
* @todo - deal with
* quotes and backslashes
* in file names.
*/
- while (*q && !isspace((int) *q)) q++;
+ while (*q && !isspace((uint8_t) *q)) q++;
*q = '\0';
/*
* The argument isn't -L foo, skip it.
*/
- while (*p && !isspace((int) *p)) p++;
+ while (*p && !isspace((uint8_t) *p)) p++;
}
/*
FILE *fp;
unsigned int i;
- if ((argc == 0) || !*argv[0] || isspace((int) *argv[0])) {
+ if ((argc == 0) || !*argv[0] || isspace((uint8_t) *argv[0])) {
/*
* Print Makefile rules to redefine the variables we've created.
*/
p = *in;
- while (*p && !isspace((int) *p)) p++;
+ while (*p && !isspace((uint8_t) *p)) p++;
if (!*p) {
*in = NULL;
} else {
#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);\
break;
case 'r':
- if (!isdigit((int) *optarg)) usage();
+ if (!isdigit((uint8_t) *optarg)) usage();
retries = atoi(optarg);
if ((retries == 0) || (retries > 1000)) usage();
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_table_value_by_str(request_types, argv[2], -2);
if (packet_code == -2) {
ERROR("Unknown packet type: %s", argv[2]);
break;
case 'c':
- if (!isdigit((int) *optarg)) usage();
+ if (!isdigit((uint8_t) *optarg)) usage();
resend_count = atoi(optarg);
break;
case 'i':
- if (!isdigit((int) *optarg))
+ if (!isdigit((uint8_t) *optarg))
usage();
last_used_id = atoi(optarg);
if ((last_used_id < 0) || (last_used_id > 255)) {
break;
case 'r':
- if (!isdigit((int) *optarg)) usage();
+ if (!isdigit((uint8_t) *optarg)) usage();
retries = atoi(optarg);
if ((retries == 0) || (retries > 1000)) usage();
break;
/*
* Get the request type
*/
- if (!isdigit((int) argv[2][0])) {
+ if (!isdigit((uint8_t) argv[2][0])) {
packet_code = fr_table_value_by_str(fr_request_types, argv[2], -2);
if (packet_code == -2) {
ERROR("Unrecognised request type \"%s\"", argv[2]);
break;
case 'r':
- if (!isdigit((int) *optarg)) usage();
+ if (!isdigit((uint8_t) *optarg)) usage();
conf->retries = atoi(optarg);
if ((conf->retries == 0) || (conf->retries > 1000)) usage();
break;
/*
* Get the request type
*/
- if (!isdigit((int) argv[2][0])) {
+ if (!isdigit((uint8_t) argv[2][0])) {
int code;
code = fr_table_value_by_str(fr_request_types, argv[2], -1);
if (!*p) break;
- c1 = memchr(hextab, tolower((int) *p++), sizeof(hextab));
+ c1 = memchr(hextab, tolower((uint8_t) *p++), sizeof(hextab));
if (!c1) {
bad_input:
fr_strerror_printf("Invalid hex data starting at \"%s\"", p);
return -(p - in);
}
- c2 = memchr(hextab, tolower((int)*p++), sizeof(hextab));
+ c2 = memchr(hextab, tolower((uint8_t)*p++), sizeof(hextab));
if (!c2) goto bad_input;
*out_p++ = ((c1 - hextab) << 4) + (c2 - hextab);
{
ssize_t slen;
- if (!isspace((int) *p)) {
+ if (!isspace((uint8_t) *p)) {
ERROR("Invalid character following attribute definition");
return 0;
}
name = p;
fr_skip_whitespace(p);
- if (isspace(*p)) {
+ if (isspace((uint8_t) *p)) {
*p = '\0';
p++;
}
continue;
}
if (skip) {
- while ((tolower(*t) != tolower(*v)) && (v <= v_end)) v++;
+ while ((tolower((uint8_t) *t) != tolower((uint8_t) *v)) && (v <= v_end)) v++;
}
- if (tolower(*t) != tolower(*v)) break;
+ if (tolower((uint8_t) *t) != tolower((uint8_t) *v)) break;
skip = false;
t++;
v++;
* Grab all of the non-whitespace text.
*/
value = ptr;
- while (*ptr && !isspace((int) *ptr)) ptr++;
+ while (*ptr && !isspace((uint8_t) *ptr)) ptr++;
/*
* We're OK with whitespace after the filename.
* 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;
* Keep parsing the condition until we hit EOS or EOL.
*/
while ((end && (p < end)) || *p) {
- if (isspace((int) *p)) {
+ if (isspace((uint8_t) *p)) {
p++;
continue;
}
name2 = buff[2];
while (slen > 0) {
- if (!isspace((int) buff[2][slen])) break;
+ if (!isspace((uint8_t) buff[2][slen])) break;
buff[2][slen] = '\0';
slen--;
return -1;
}
- } else if ((name1_token == T_BARE_WORD) && isalpha((int) *buff[1])) {
+ } else if ((name1_token == T_BARE_WORD) && isalpha((uint8_t) *buff[1])) {
fr_type_t type;
/*
* it, so oh well.
*/
if ((*ptr == '"') || (*ptr == '`') || (*ptr == '\'') || ((*ptr == '&') && (ptr[1] != '=')) ||
- ((*((uint8_t const *) ptr) & 0x80) != 0) || isalpha((int) *ptr) || isdigit((int) *ptr)) {
+ ((*((uint8_t const *) ptr) & 0x80) != 0) || isalpha((uint8_t) *ptr) || isdigit((uint8_t) *ptr)) {
if (cf_get_token(parent, &ptr, &name2_token, buff[2], stack->bufsize,
frame->filename, frame->lineno) < 0) {
return -1;
}
for (p = argv->name; *p != '\0'; p++) {
- if (isupper((int) *p)) uppercase = true;
- if (islower((int) *p)) lowercase = true;
+ if (isupper((uint8_t) *p)) uppercase = true;
+ if (islower((uint8_t) *p)) lowercase = true;
}
/*
p++; \
q++; \
} } while (0)
-#define MATCHED_NAME ((!*p || isspace((int) *p)) && !*q)
+#define MATCHED_NAME ((!*p || isspace((uint8_t) *p)) && !*q)
#define TOO_FAR (*p && (*q > *p))
#define MATCHED_START ((text + start) >= word) && ((text + start) <= p)
* Tell the caller the
* full name.
*/
- if (!*p || (isspace((int) *p))) {
+ if (!*p || (isspace((uint8_t) *p))) {
expand_name:
expansions[count] = strdup(argv->name);
count++;
* matching all of the name. The input is a
* PARTIAL match. Go fill it in.
*/
- if (!*p || isspace((int) *p)) {
+ if (!*p || isspace((uint8_t) *p)) {
goto expand_name;
}
* Matched all of the input to
* part of cmd->name.
*/
- if (!*p || isspace((int) *p)) {
+ if (!*p || isspace((uint8_t) *p)) {
expansions[count] = strdup(cmd->name);
count++;
}
for (q = c->data.vpt->name;
*q != '\0';
q++) {
- if (!isdigit((int) *q)) {
+ if (!isdigit((uint8_t) *q)) {
break;
}
if (*q != '0') zeros = false;
if (!module_name) return NULL;
- for (p = module_name, q = p + talloc_array_length(p) - 1; p < q; p++) *p = tolower(*p);
+ for (p = module_name, q = p + talloc_array_length(p) - 1; p < q; p++) *p = tolower((uint8_t) *p);
/*
* If the module's already been loaded, increment the reference count.
* for the first char.
*/
p = fr_sbuff_current(&env_m[i]);
- if (isdigit((int)*p)) *p++ = '_';
+ if (isdigit((uint8_t)*p)) *p++ = '_';
for (; p < fr_sbuff_current(&sbuff); p++) {
- if (isalpha((int)*p)) *p = toupper(*p);
+ if (isalpha((uint8_t)*p)) *p = toupper((uint8_t) *p);
else if (*p == '-') *p = '_';
- else if (isdigit((int)*p)) continue;
+ else if (isdigit((uint8_t)*p)) continue;
else *p = '_';
}
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);
}
}
}
{
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++;
if (!fr_dict_attr_allowed_chars[(uint8_t) *d]) {
*out = def;
*type = T_INVALID;
if (castda) *castda = NULL;
- while (isspace((int) *p) && (p < end)) p++;
+ while (isspace((uint8_t) *p) && (p < end)) p++;
if (p >= end) return p - in;
if (*p == '<') {
p++;
fr_skip_whitespace(p);
- for (q = p; *q && !isspace((int) *q) && (*q != '>'); q++) {
+ for (q = p; *q && !isspace((uint8_t) *q) && (*q != '>'); q++) {
/* nothing */
}
* Allow *most* things. But stop on spaces and special characters.
*/
while (*p) {
- if (isspace((int) *p)) {
+ if (isspace((uint8_t) *p)) {
break;
}
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;
}
* Seems to print info in a tabular format.
*/
while (*p != '\0') {
- if (isspace(*p)) {
+ if (isspace((uint8_t) *p)) {
*q++ = *p;
fr_skip_whitespace(p);
continue;
token = cf_section_name2_quote(cs);
- if ((token == T_BARE_WORD) && isdigit((int) *name2)) {
+ if ((token == T_BARE_WORD) && isdigit((uint8_t) *name2)) {
if (fr_time_delta_from_str(&timeout, name2, strlen(name2), FR_TIME_RES_SEC) < 0) {
cf_log_err(cs, "Failed parsing time delta %s - %s",
name2, fr_strerror());
* We limit it to REPETITION_MAX, because we don't want
* utter stupidity.
*/
- if (isdigit((int) *p)) {
+ if (isdigit((uint8_t) *p)) {
reps = strtol(p, &endptr, 10);
if (reps > REPETITION_MAX) reps = REPETITION_MAX;
outlen += reps;
while (p < end) {
size_t i;
- if (isdigit((int) *p)) {
+ if (isdigit((uint8_t) *p)) {
reps = strtol(p, &endptr, 10);
if (reps > REPETITION_MAX) {
reps = REPETITION_MAX;
end = p + vb->vb_length;
while (p < end) {
- *(p) = upper ? toupper ((int) *(p)) : tolower((int) *(p));
+ *(p) = upper ? toupper ((int) *(p)) : tolower((uint8_t) *(p));
p++;
}
/* 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(in_head->vb_strvalue, p - in_head->vb_strvalue, "Non-hex char in %% sequence");
talloc_free(vb);
strlcpy(name, fr_dict_root(dict)->name, sizeof(name));
for (p = name; *p != '\0'; p++) {
- *p = tolower((int) *p);
+ *p = tolower((uint8_t) *p);
}
/*
#define fr_sbuff_skip_whitespace(_x) \
do { \
- while (isspace((int) fr_sbuff_char(_x, '\0'))) fr_sbuff_advance(_x, 1); \
+ while (isspace((uint8_t) fr_sbuff_char(_x, '\0'))) fr_sbuff_advance(_x, 1); \
} while (0)
static ssize_t tokenize_expression(xlat_exp_head_t *head, xlat_exp_t **out, fr_sbuff_t *in,
if (*str == '.') break;
- c = memchr(tab, tolower((int)*str), base);
+ c = memchr(tab, tolower((uint8_t)*str), base);
if (!c) return 0;
ret *= 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("Invalid format for VENDOR. Expected text like '1,1', got '%s'",
p);
if (!name) return 0;
module_name = talloc_typed_asprintf(NULL, "libfreeradius-%s", name);
- for (p = module_name, q = p + talloc_array_length(p) - 1; p < q; p++) *p = tolower(*p);
+ for (p = module_name, q = p + talloc_array_length(p) - 1; p < q; p++) *p = tolower((uint8_t) *p);
/*
* Pass in dict as the uctx so that we can get at it in
}
if (servname) {
- if (isdigit((int)*servname)) {
+ if (isdigit((uint8_t)*servname)) {
port = htons(atoi(servname));
} else {
struct servent *se;
while (*p) {
hash *= FNV_MAGIC_PRIME;
- hash ^= (uint32_t) (tolower(*p++));
+ hash ^= (uint32_t) (tolower((uint8_t) *p++));
}
return hash;
memset(out, 0, sizeof(*out));
end = value + inlen;
- while ((value < end) && isspace((int) *value)) value++;
+ while ((value < end) && isspace((uint8_t) *value)) value++;
if (value == end) {
fr_strerror_const("Empty IPv4 address string is invalid");
return -1;
if (inlen < 0) inlen = strlen(value);
end = value + inlen;
- while ((value < end) && isspace((int) *value)) value++;
+ while ((value < end) && isspace((uint8_t) *value)) value++;
if (value == end) {
fr_strerror_const("Empty IPv6 address string is invalid");
return -1;
char const *end;
end = value + inlen;
- while ((value < end) && isspace((int) *value)) value++;
+ while ((value < end) && isspace((uint8_t) *value)) value++;
if (value == end) {
fr_strerror_const("Empty IPv4 address string is invalid");
return -1;
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 (!str || !size) return NULL;
memcpy(&q, &str, sizeof(q));
- for (q = q + size; q > str && isspace(*q); q--);
+ for (q = q + size; q > str && isspace((uint8_t) *q); q--);
return q;
}
*
* @param[in,out] _p string to skip over.
*/
-#define fr_skip_whitespace(_p) while(isspace((int)*(_p))) _p++
+#define fr_skip_whitespace(_p) while(isspace((uint8_t)*(_p))) _p++
/** Skip whitespace, stopping at end ('\\t', '\\n', '\\v', '\\f', '\\r', ' ')
*
* @param[in,out] _p string to skip over.
* @param[in] _e pointer to end of string.
*/
-#define fr_bskip_whitespace(_p, _e) while((_p < _e) && isspace((int)*(_p))) _p++
+#define fr_bskip_whitespace(_p, _e) while((_p < _e) && isspace((uint8_t)*(_p))) _p++
/** Skip everything that's not whitespace ('\\t', '\\n', '\\v', '\\f', '\\r', ' ')
*
* @param[in,out] _p string to skip over.
*/
-#define fr_skip_not_whitespace(_p) while(*_p && !isspace((int)*(_p))) _p++
+#define fr_skip_not_whitespace(_p) while(*_p && !isspace((uint8_t)*(_p))) _p++
/** Zero out any whitespace with nul bytes
*
* @param[in,out] _p string to process
*/
-#define fr_zero_whitespace(_p) while (isspace((int) *_p)) *(_p++) = '\0'
+#define fr_zero_whitespace(_p) while (isspace((uint8_t) *_p)) *(_p++) = '\0'
/** Check whether the string is all whitespace
*
if (*value == '\0') return false; /* clang analyzer doesn't seem to know what isspace does */
#endif
do {
- if (!isspace(*value)) return false;
+ if (!isspace((uint8_t) *value)) return false;
} while (*++value);
return true;
if (*value == '\0') return false; /* clang analyzer doesn't seem to know what isdigit does */
#endif
do {
- if (!isdigit(*value)) return false;
+ if (!isdigit((uint8_t) *value)) return false;
} while (*++value);
return true;
return -(in - start);
}
- while ((isspace((int) *p)) && (p < end)) p++;
+ while ((isspace((uint8_t) *p)) && (p < end)) p++;
if (p >= end) {
fr_strerror_const("No operator found in the input buffer");
}
p += slen;
- while ((isspace((int) *p)) && (p < end)) p++;
+ while ((isspace((uint8_t) *p)) && (p < end)) p++;
if (p >= end) {
fr_strerror_const("No value found in the input buffer");
/*
* Skip bare words, but end at comma or end-of-buffer.
*/
- while (!isspace((int) *p) && (*p != ',') && (p < end)) p++;
+ while (!isspace((uint8_t) *p) && (*p != ',') && (p < end)) p++;
value_len = p - value;
}
ssize_t slen;
fr_dict_attr_t const *da;
- while (isspace((int) *p) && (p < end)) p++;
+ while (isspace((uint8_t) *p) && (p < end)) p++;
if (p >= end) return end - in;
/*
/*
* Check for parameter field
*/
- for (q = p; isdigit(*q); q++);
+ for (q = p; isdigit((uint8_t) *q); q++);
if ((q != p) && (*q == '$')) {
p = q + 1;
}
(void) va_arg(ap_q, int);
p++;
} else {
- for (q = p; isdigit(*q); q++);
+ for (q = p; isdigit((uint8_t) *q); q++);
p = q;
}
} \
if ((errno == ERANGE) && (num == LLONG_MIN)) goto underflow; \
if (no_trailing && (((a_end = in->p + (end - buff)) + 1) < in->end)) { \
- if (isdigit(*a_end) || (((_base > 10) || ((_base == 0) && (len > 2) && (buff[0] == '0') && (buff[1] == 'x'))) && \
- ((tolower(*a_end) >= 'a') && (tolower(*a_end) <= 'f')))) { \
+ if (isdigit((uint8_t) *a_end) || (((_base > 10) || ((_base == 0) && (len > 2) && (buff[0] == '0') && (buff[1] == 'x'))) && \
+ ((tolower((uint8_t) *a_end) >= 'a') && (tolower((uint8_t) *a_end) <= 'f')))) { \
if (err) *err = FR_SBUFF_PARSE_ERROR_TRAILING; \
*out = (_type)(_max); \
FR_SBUFF_ERROR_RETURN(&our_in); \
} \
if (((errno == EINVAL) && (num == 0)) || ((errno == ERANGE) && (num == ULLONG_MAX))) goto overflow; \
if (no_trailing && (((a_end = in->p + (end - buff)) + 1) < in->end)) { \
- if (isdigit(*a_end) || (((_base > 10) || ((_base == 0) && (len > 2) && (buff[0] == '0') && (buff[1] == 'x'))) && \
- ((tolower(*a_end) >= 'a') && (tolower(*a_end) <= 'f')))) { \
+ if (isdigit((uint8_t) *a_end) || (((_base > 10) || ((_base == 0) && (len > 2) && (buff[0] == '0') && (buff[1] == 'x'))) && \
+ ((tolower((uint8_t) *a_end) >= 'a') && (tolower((uint8_t) *a_end) <= 'f')))) { \
if (err) *err = FR_SBUFF_PARSE_ERROR_TRAILING; \
*out = (_type)(_max); \
FR_SBUFF_ERROR_RETURN(&our_in); \
end = p + needle_len;
for (p = sbuff->p, n_p = needle; p < end; p++, n_p++) {
- if (tolower(*p) != tolower(*n_p)) return 0;
+ if (tolower((uint8_t) *p) != tolower((uint8_t) *n_p)) return 0;
}
return fr_sbuff_advance(sbuff, needle_len);
if (fr_sbuff_extend_lowat(NULL, &our_sbuff, needle_len) < needle_len) break;
for (p = our_sbuff.p, n_p = needle, end = our_sbuff.p + needle_len;
- (p < end) && (tolower(*p) == tolower(*n_p));
+ (p < end) && (tolower((uint8_t) *p) == tolower((uint8_t) *n_p));
p++, n_p++);
if (p == end) {
(void)fr_sbuff_set(sbuff, our_sbuff.p);
fr_sbuff_marker_t * : _fr_marker_is_ ## _name((fr_sbuff_marker_t *)(_sbuff_or_marker), fr_sbuff_current(_sbuff_or_marker)) \
)
-SBUFF_IS_FUNC(digit, isdigit(*p))
+SBUFF_IS_FUNC(digit, isdigit((uint8_t) *p))
#define fr_sbuff_is_digit(_sbuff_or_marker) \
SBUFF_IS_GENERIC(_sbuff_or_marker, digit)
-SBUFF_IS_FUNC(upper, isupper(*p))
+SBUFF_IS_FUNC(upper, isupper((uint8_t) *p))
#define fr_sbuff_is_upper(_sbuff_or_marker) \
SBUFF_IS_GENERIC(_sbuff_or_marker, upper)
-SBUFF_IS_FUNC(lower, islower(*p))
+SBUFF_IS_FUNC(lower, islower((uint8_t) *p))
#define fr_sbuff_is_lower(_sbuff_or_marker) \
SBUFF_IS_GENERIC(_sbuff_or_marker, lower)
-SBUFF_IS_FUNC(alpha, isalpha(*p))
+SBUFF_IS_FUNC(alpha, isalpha((uint8_t) *p))
#define fr_sbuff_is_alpha(_sbuff_or_marker) \
SBUFF_IS_GENERIC(_sbuff_or_marker, alpha)
-SBUFF_IS_FUNC(space, isspace(*p))
+SBUFF_IS_FUNC(space, isspace((uint8_t) *p))
#define fr_sbuff_is_space(_sbuff_or_marker) \
SBUFF_IS_GENERIC(_sbuff_or_marker, space)
-SBUFF_IS_FUNC(hex, isxdigit(*p))
+SBUFF_IS_FUNC(hex, isxdigit((uint8_t) *p))
#define fr_sbuff_is_hex(_sbuff_or_marker) \
SBUFF_IS_GENERIC(_sbuff_or_marker, hex)
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';
{
char *p = *str;
- if (!isdigit((int) *p) || !isdigit((int) p[1])) return -1;
+ if (!isdigit((uint8_t) *p) || !isdigit((uint8_t) p[1])) return -1;
*date = (p[0] - '0') * 10 + (p[1] - '0');
if (*date < min) {
*/
tm->tm_mon = 12;
for (i = 0; i < 3; i++) {
- if (isalpha((int) *f[i])) {
+ if (isalpha((uint8_t) *f[i])) {
int j;
/*
* comma.
*/
if (!quote) {
- if (isspace((int) *p)) break;
+ if (isspace((uint8_t) *p)) break;
if (tok) {
/*
* \r or \n, etc.
*/
- if (!isdigit((int) p[1])) {
+ if (!isdigit((uint8_t) p[1])) {
p += 2;
continue;
}
if (end && ((p + 4) >= end)) goto fail;
- if (!isdigit((int) p[2]) || !isdigit((int) p[3])) {
+ if (!isdigit((uint8_t) p[2]) || !isdigit((uint8_t) p[3])) {
fr_strerror_const("Invalid octal escape");
return -(p - start);
}
for (p += len;
p > cmd_buffer;
p--) {
- if (!isspace((int) p[-1])) break;
+ if (!isspace((uint8_t) p[-1])) break;
p[-1] = '\0';
}
* modifies it's behavior. These commands MUST
*/
if (!stack_depth && (strncmp(line, "local", 5) == 0)) {
- if (!isspace((int) line[5])) {
+ if (!isspace((uint8_t) line[5])) {
fprintf(stderr, "'local' commands MUST be specified all on one line");
goto next;
}
/*
* EOS or space is end of field.
*/
- if (!(!*end || isspace((int) *end))) {
+ if (!(!*end || isspace((uint8_t) *end))) {
cf_log_err(ci, "Unexpected text for %s at %s", name, end);
return -1;
}
/*
* Skip attribute name
*/
- while ((p < end) && !isspace(*p)) p++;
+ while ((p < end) && !isspace((uint8_t) *p)) p++;
/*
* Not enough room for " = ", skip this sanity
break;
}
- if (isspace((int) *q)) {
+ if (isspace((uint8_t) *q)) {
cf_log_err(conf, "Field %d name cannot have spaces.",
i + 1);
return -1;
/* Is a = char */
if (((end - p) < 2) ||
- !(c1 = memchr(hextab, tolower(*(p + 1)), 16)) ||
- !(c2 = memchr(hextab, tolower(*(p + 2)), 16))) goto next;
+ !(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);
(void) fr_sbuff_in_char(&sbuff, c3);
if (*p == '"') {
p++;
- if (isspace((int) *p)) {
+ if (isspace((uint8_t) *p)) {
if (skip_spaces(state, p) < 0) return -1;
break;
}
* or semi-colon. We skip those characters
* before looking for the next token.
*/
- while (isspace((int) *state->ptr) || (*state->ptr == ';') || (*state->ptr == ',')) state->ptr++;
+ while (isspace((uint8_t) *state->ptr) || (*state->ptr == ';') || (*state->ptr == ',')) state->ptr++;
if (!*state->ptr) goto redo;
/*
* Whitespace, we're done.
*/
- if (isspace((int) *p)) {
+ if (isspace((uint8_t) *p)) {
if (skip_spaces(state, p) < 0) return -1;
break;
}
* Remember the next command.
*/
next = q = cmd;
- while (*next && !isspace((int) *next) && (*next != ',')) next++;
+ while (*next && !isspace((uint8_t) *next) && (*next != ',')) next++;
if (!*next) semicolon = YES_SEMICOLON;
/*
* Matching an in-line word.
*/
- if (islower((int) *q)) {
+ if (islower((uint8_t) *q)) {
ret = read_token(state, T_BARE_WORD, semicolon, false);
if (ret <= 0) return -1;
* Matched all of this word in 'q', but there are
* more words after this one.. Recurse.
*/
- if (isspace((int) *q)) {
+ if (isspace((uint8_t) *q)) {
return match_subword(state, next, info);
}
* multiple fields.
*/
p = type_name;
- while (*q && !isspace((int) *q) && (*q != ',')) {
+ while (*q && !isspace((uint8_t) *q) && (*q != ',')) {
if ((p - type_name) >= (int) sizeof(type_name)) return -1; /* internal error */
- *(p++) = tolower((int) *(q++));
+ *(p++) = tolower((uint8_t) *(q++));
}
*p = '\0';
/*
* The token exactly matches the command.
*/
- if (!c || isspace((int) c)) {
+ if (!c || isspace((uint8_t) c)) {
q = &(tokens[half].name[state->token_len]);
break;
}
* There's more to this command,
* go parse that, too.
*/
- if (isspace((int) *q)) {
+ if (isspace((uint8_t) *q)) {
if (state->saw_semicolon) goto unexpected;
ret = match_subword(state, q, info);
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) {
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);
if (!content_type_set && (strncasecmp(header->vp_strvalue, "content-type:", sizeof("content-type:") - 1) == 0)) {
char const *content_type = header->vp_strvalue + (sizeof("content-type:") - 1);
- while (isspace((int)*content_type)) content_type++;
+ while (isspace((uint8_t)*content_type)) content_type++;
RDEBUG3("Request body content-type provided as \"%s\"", content_type);
fr_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("num=%d, last=%c",num,last);
fr_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("num=%d, last=%c", num, last);
if (modhex[i + 1] == '\0')
return -1;
- if (!(c1 = memchr(modhextab, tolower((int) modhex[i]), 16)) ||
- !(c2 = memchr(modhextab, tolower((int) modhex[i + 1]), 16)))
+ if (!(c1 = memchr(modhextab, tolower((uint8_t) modhex[i]), 16)) ||
+ !(c2 = memchr(modhextab, tolower((uint8_t) modhex[i + 1]), 16)))
return -1;
hex[i] = hextab[c1 - modhextab];