diff options
-rw-r--r-- | llex.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: llex.c,v 2.51 2011/07/06 16:45:14 roberto Exp roberto $ | 2 | ** $Id: llex.c,v 2.52 2011/07/08 19:17:30 roberto Exp roberto $ |
3 | ** Lexical Analyzer | 3 | ** Lexical Analyzer |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -314,9 +314,9 @@ static int readhexaesc (LexState *ls) { | |||
314 | 314 | ||
315 | static int readdecesc (LexState *ls) { | 315 | static int readdecesc (LexState *ls) { |
316 | int c[3], r; | 316 | int c[3], r; |
317 | int i = 0; | 317 | int i = 2; /* at least two chars will be read */ |
318 | c[i++] = ls->current; /* first char must be a digit */ | 318 | c[0] = ls->current; /* first char must be a digit */ |
319 | c[i++] = next(ls); /* read second char */ | 319 | c[1] = next(ls); /* read second char */ |
320 | r = c[0] - '0'; /* partial result */ | 320 | r = c[0] - '0'; /* partial result */ |
321 | if (lisdigit(c[1])) { | 321 | if (lisdigit(c[1])) { |
322 | c[i++] = next(ls); /* read third char */ | 322 | c[i++] = next(ls); /* read third char */ |