lualib: fix error_func_pos computing

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2009-08-14 14:36:56 +02:00
parent a2623225c1
commit 0cc5d85111
1 changed files with 1 additions and 1 deletions

View File

@ -107,7 +107,7 @@ luaA_dofunction(lua_State *L, int nargs, int nret)
lua_pushcfunction(L, luaA_dofunction_error);
/* Move error handling function before args and function */
lua_insert(L, - nargs - 2);
int error_func_pos = lua_gettop(L) - nargs - 2;
int error_func_pos = lua_gettop(L) - nargs - 1;
if(lua_pcall(L, nargs, nret, - nargs - 2))
{
warn("%s", lua_tostring(L, -1));