From 197379a33aed023d4e44b4db5fff7ded657e3479 Mon Sep 17 00:00:00 2001 From: eck Date: Thu, 1 Feb 1990 13:09:40 +0000 Subject: [PATCH] fixed bug with character constants --- lang/cem/cpp.ansi/LLlex.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/lang/cem/cpp.ansi/LLlex.c b/lang/cem/cpp.ansi/LLlex.c index 85ea38215..6c0b124f9 100644 --- a/lang/cem/cpp.ansi/LLlex.c +++ b/lang/cem/cpp.ansi/LLlex.c @@ -351,15 +351,15 @@ char_constant(nm) if (ch == '\\') ch = quoted(GetChar()); if (ch >= 128) ch -= 256; - if (size < (int)size) - val |= ch << 8 * size; + if (size < sizeof(arith)) + val |= ch << (8 * size); size++; ch = GetChar(); } - if (size > 1) - strict("%s constant includes more than one character", nm); if (size > sizeof(arith)) error("%s constant too long", nm); + else if (size > 1) + strict("%s constant includes more than one character", nm); return val; } @@ -441,8 +441,7 @@ quoted(ch) ch = hex; } } - } - else { /* a quoted octal */ + } else { /* a quoted octal */ register int oct = 0, cnt = 0; do { -- 2.34.1