about summary refs log tree commit diff
path: root/lr.c
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2015-10-26 22:21:12 +0100
committerChristian Neukirchen <chneukirchen@gmail.com>2015-10-26 22:21:12 +0100
commite001541c2db73cece60c0a8660fb345314eac2ff (patch)
treee073dc88de4595898178f6c97c06a69e39605e81 /lr.c
parent66b29969d4e95fc895ec7e163fed31ed0f0a9a8e (diff)
downloadlr-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.c8
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;