diff --git a/ag.cc b/ag.cc index 53975af..e5d0c73 100644 --- a/ag.cc +++ b/ag.cc @@ -37,10 +37,10 @@ namespace ag if (!first) cout << ", "; cout << '['; - ag_print_val(L, index + 1); + ag_print_val(L, lua_gettop(L) - 1); cout << ']'; cout << " => "; - ag_print_val(L, index + 2); + ag_print_val(L, lua_gettop(L)); lua_pop(L, 1); }