better control when growing arrays.

This commit is contained in:
Roberto Ierusalimschy
1996-03-21 13:33:47 -03:00
parent 9704ff4cb1
commit 9284742a11
8 changed files with 68 additions and 50 deletions

5
lex.c
View File

@@ -1,4 +1,4 @@
char *rcs_lex = "$Id: lex.c,v 2.30 1996/03/14 15:17:28 roberto Exp roberto $";
char *rcs_lex = "$Id: lex.c,v 2.31 1996/03/19 16:50:24 roberto Exp roberto $";
#include <ctype.h>
@@ -83,8 +83,7 @@ void luaI_addReserved (void)
static void growtext (void)
{
int size = yytextLast - yytext;
textsize *= 2;
yytext = growvector(yytext, textsize, char);
textsize = growvector(&yytext, textsize, char, lexEM, MAX_WORD);
yytextLast = yytext + size;
}