fix lua stack corruption

This commit is contained in:
takase1121 2021-07-08 17:47:18 +08:00
parent d20a9c3faf
commit 8ebb40798b
1 changed files with 2 additions and 2 deletions

View File

@ -264,8 +264,8 @@ static int f_read_stderr(lua_State* L)
static int f_read(lua_State* L)
{
int stream = luaL_checknumber(L, 1);
lua_remove(L, 1); // remove the number we just read
int stream = luaL_checknumber(L, 2);
lua_remove(L, 2);
return g_read(L, stream);
}