From c1598e9441cb9e125616dbef5e090e1f32fcdfb2 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Tue, 25 Aug 2015 13:50:20 -0400 Subject: src/scripting/ffi.c: Fix stack index --- diff --git a/src/scripting/ffi.c b/src/scripting/ffi.c index a7e9834..785db37 100644 --- a/src/scripting/ffi.c +++ b/src/scripting/ffi.c @@ -116,7 +116,7 @@ ffi_register_functions_in_namespace(lua_State *l, struct ffi_namespace *parent) if (parent == &root) { lua_setglobal(l, ns->name); } else { - lua_setfield(l, -1, ns->name); + lua_setfield(l, -2, ns->name); } } for (fn = parent->fn_head; fn != NULL; fn = fn->next) { -- cgit v0.9.1