Merge pull request #92 from lzutao/fix-ctype

Cast argument to unsigned char before passing to ctype.h function
This commit is contained in:
Daniel Holden
2018-11-07 13:04:50 -05:00
committed by GitHub

4
mpc.c
View File

@@ -2443,7 +2443,7 @@ mpc_val_t *mpcf_float(mpc_val_t *x) {
mpc_val_t *mpcf_strtriml(mpc_val_t *x) {
char *s = x;
while (isspace(*s)) {
while (isspace((unsigned char)*s)) {
memmove(s, s+1, strlen(s));
}
return s;
@@ -2452,7 +2452,7 @@ mpc_val_t *mpcf_strtriml(mpc_val_t *x) {
mpc_val_t *mpcf_strtrimr(mpc_val_t *x) {
char *s = x;
size_t l = strlen(s);
while (isspace(s[l-1])) {
while (isspace((unsigned char)s[l-1])) {
s[l-1] = '\0'; l--;
}
return s;