From a97f29f15487c5f584185f646f9cfc06a04b26ca Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Tue, 29 Aug 2000 17:43:28 -0300 Subject: explicit stack control in the API --- liolib.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'liolib.c') diff --git a/liolib.c b/liolib.c index 4c0cbf2b..0a310de0 100644 --- a/liolib.c +++ b/liolib.c @@ -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; -- cgit v1.2.3-55-g6feb