explicit stack control in the API

This commit is contained in:
Roberto Ierusalimschy 2000-08-29 17:43:28 -03:00
parent 4135f4f586
commit a97f29f154
7 changed files with 27 additions and 16 deletions

View file

@ -1,5 +1,5 @@
/*
** $Id: liolib.c,v 1.72 2000/08/28 17:57:04 roberto Exp roberto $
** $Id: liolib.c,v 1.73 2000/08/29 14:33:31 roberto Exp roberto $
** Standard I/O (and system) library
** See Copyright Notice in lua.h
*/
@ -372,6 +372,7 @@ static int io_read (lua_State *L) {
firstarg = lastarg = 1; /* correct indices */
lua_pushstring(L, "*l"); /* push default argument */
}
luaL_checkstack(L, lastarg-firstarg+1, "too many results");
for (n = firstarg; n<=lastarg; n++) {
size_t l;
int success;