fixed bug with character constants
This commit is contained in:
parent
0c5cce9a96
commit
197379a33a
1 changed files with 5 additions and 6 deletions
|
@ -351,15 +351,15 @@ char_constant(nm)
|
||||||
if (ch == '\\')
|
if (ch == '\\')
|
||||||
ch = quoted(GetChar());
|
ch = quoted(GetChar());
|
||||||
if (ch >= 128) ch -= 256;
|
if (ch >= 128) ch -= 256;
|
||||||
if (size < (int)size)
|
if (size < sizeof(arith))
|
||||||
val |= ch << 8 * size;
|
val |= ch << (8 * size);
|
||||||
size++;
|
size++;
|
||||||
ch = GetChar();
|
ch = GetChar();
|
||||||
}
|
}
|
||||||
if (size > 1)
|
|
||||||
strict("%s constant includes more than one character", nm);
|
|
||||||
if (size > sizeof(arith))
|
if (size > sizeof(arith))
|
||||||
error("%s constant too long", nm);
|
error("%s constant too long", nm);
|
||||||
|
else if (size > 1)
|
||||||
|
strict("%s constant includes more than one character", nm);
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -441,8 +441,7 @@ quoted(ch)
|
||||||
ch = hex;
|
ch = hex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} else { /* a quoted octal */
|
||||||
else { /* a quoted octal */
|
|
||||||
register int oct = 0, cnt = 0;
|
register int oct = 0, cnt = 0;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
|
|
Loading…
Reference in a new issue