From b9adc507d25ec5f41463d31ef54751c1180c3db2 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Sun, 23 Jan 2022 01:05:27 +0000 Subject: cc: fix incorrect octal range condition in mpatov This does not have any adverse effect, since yylex never calls mpatov with a string with leading 0 (and not 0x) that contains non-octal digits, but the condition was wrong regardless. --- sys/src/cmd/cc/lex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sys/src/cmd/cc') diff --git a/sys/src/cmd/cc/lex.c b/sys/src/cmd/cc/lex.c index 707fb0bac..6a9f1ea9c 100644 --- a/sys/src/cmd/cc/lex.c +++ b/sys/src/cmd/cc/lex.c @@ -982,7 +982,7 @@ oct: if(c == 'x' || c == 'X') goto hex; while(c = *s++) { - if(c >= '0' || c <= '7') + if(c >= '0' && c <= '7') nn = n*8 + c-'0'; else goto bad; -- cgit v1.2.3