From: ceriel Date: Tue, 26 Apr 1988 13:47:02 +0000 (+0000) Subject: fixed: did not compute hexadecimal numbers right X-Git-Tag: release-5-5~3322 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=bfd4554758b0c8de83b2129d56e0d8299bd7ec80;p=ack.git fixed: did not compute hexadecimal numbers right --- diff --git a/lang/m2/comp/LLlex.c b/lang/m2/comp/LLlex.c index ca1b208a2..4506d097c 100644 --- a/lang/m2/comp/LLlex.c +++ b/lang/m2/comp/LLlex.c @@ -496,9 +496,17 @@ again: tk->TOK_INT = 0; while (*np) { arith old = tk->TOK_INT; - + int c; + + if (is_dig(*np)) { + c = *np++ - '0'; + } + else { + assert(is_hex(*np)); + c = *np++ - 'A' + 10; + } tk->TOK_INT = tk->TOK_INT*base - + (*np++ - '0'); + + c; sgnswtch += (old < 0) ^ (tk->TOK_INT < 0); }