Skip to content

Commit

Permalink
fixed bug with trimming string with all space characters
Browse files Browse the repository at this point in the history
  • Loading branch information
orangeduck committed Sep 1, 2019
1 parent e1038bc commit 5120609
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2470,7 +2470,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((unsigned char)s[l-1])) {
while (l > 0 && isspace((unsigned char)s[l-1])) {
s[l-1] = '\0'; l--;
}
return s;
Expand Down

0 comments on commit 5120609

Please sign in to comment.