diff options
author | Christian Neukirchen <chneukirchen@gmail.com> | 2015-10-26 22:21:12 +0100 |
---|---|---|
committer | Christian Neukirchen <chneukirchen@gmail.com> | 2015-10-26 22:21:12 +0100 |
commit | e001541c2db73cece60c0a8660fb345314eac2ff (patch) | |
tree | e073dc88de4595898178f6c97c06a69e39605e81 /lr.c | |
parent | 66b29969d4e95fc895ec7e163fed31ed0f0a9a8e (diff) | |
download | lr-e001541c2db73cece60c0a8660fb345314eac2ff.tar.gz lr-e001541c2db73cece60c0a8660fb345314eac2ff.tar.xz lr-e001541c2db73cece60c0a8660fb345314eac2ff.zip |
use isspace/isdigit with (unsigned char)
Diffstat (limited to 'lr.c')
-rw-r--r-- | lr.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lr.c b/lr.c index 99b6a22..bac781f 100644 --- a/lr.c +++ b/lr.c @@ -183,7 +183,7 @@ mkexpr(enum op op) static void ws() { - while (isspace(*pos)) + while (isspace((unsigned char) *pos)) pos++; } @@ -202,12 +202,12 @@ token(const char *token) static int64_t parse_num(int64_t *r) { - if (isdigit(*pos)) { + if (isdigit((unsigned char) *pos)) { int64_t n; - for (n = 0; isdigit(*pos) && n <= INT64_MAX / 10 - 10; pos++) + for (n = 0; isdigit((unsigned char) *pos) && n <= INT64_MAX / 10 - 10; pos++) n = 10 * n + (*pos - '0'); - if (isdigit(*pos)) + if (isdigit((unsigned char) *pos)) parse_error("number too big"); if (token("c")) ; else if (token("b")) n *= 512LL; |