From: Alan Cox Date: Sun, 20 Nov 2016 18:02:45 +0000 (+0000) Subject: cc65: remove un-needed logic from octal parsing X-Git-Tag: V2.16~60^2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=refs%2Fpull%2F358%2Fhead;p=cc65 cc65: remove un-needed logic from octal parsing We no longer need the extra error handling logic for octal parsing so simplify it as requested by Greg King. Signed-off-by: Alan Cox --- diff --git a/src/cc65/scanner.c b/src/cc65/scanner.c index d867c9857..c9009bc2f 100644 --- a/src/cc65/scanner.c +++ b/src/cc65/scanner.c @@ -337,20 +337,14 @@ static int ParseChar (void) case '6': case '7': /* Octal constant */ - HadError = 0; Count = 1; C = HexVal (CurC); while (IsODigit (NextC) && Count++ < 3) { - if ((C << 3) >= 256) { - if (!HadError) { - Error ("Octal character constant out of range"); - HadError = 1; - } - } else { - C = (C << 3) | HexVal (NextC); - } + C = (C << 3) | HexVal (NextC); NextChar (); } + if (C >= 256) + Error ("Octal character constant out of range"); break; default: Error ("Illegal character constant");