On architectures where "char" is signed, it should be cast to unsigned
char before being passed as parameter to isdigit or isspace. Based on
their man page:
These functions check whether c, which must have the value of an
unsigned char or EOF, falls into a certain character class according to
the specified locale.
Passing a signed char as parameter is invalid if the values fall into
the negative range of the signed char.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
if(local_test_name) {
name_is_digits = 1;
for(c = local_test_name; *c != '\0'; c++) {
- if(!isdigit(*c) && !isspace(*c)) {
+ if(!isdigit((unsigned char)*c) &&
+ !isspace((unsigned char)*c)) {
name_is_digits = 0;
break;
}