Issue2681: the literal 0o8 was wrongly accepted, and evaluated as float(0.0).

This happened only when 8 is the first digit.
Credits go to Lukas Meuser.
This commit is contained in:
Amaury Forgeot d'Arc 2008-04-24 18:07:05 +00:00
parent 11034c6c16
commit 5216721a53
3 changed files with 5 additions and 2 deletions

View file

@ -1351,7 +1351,7 @@ tok_get(register struct tok_state *tok, char **p_start, char **p_end)
else if (c == 'o' || c == 'O') {
/* Octal */
c = tok_nextc(tok);
if (c < '0' || c > '8') {
if (c < '0' || c >= '8') {
tok->done = E_TOKEN;
tok_backup(tok, c);
return ERRORTOKEN;