git: 9front

Download patch

ref: da8f1d542b3eeab927a91d06405f890247db94b4
parent: b881d8e562e1d165b785139e02079256473299ce
author: Michael Forney <mforney@mforney.org>
date: Sat Jan 22 20:05:27 EST 2022

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.

--- a/sys/src/cmd/cc/lex.c
+++ b/sys/src/cmd/cc/lex.c
@@ -982,7 +982,7 @@
 	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;
--