aboutsummaryrefslogtreecommitdiff
path: root/ltablib.c
diff options
context:
space:
mode:
Diffstat (limited to 'ltablib.c')
-rw-r--r--ltablib.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ltablib.c b/ltablib.c
index dbfe2509..868d78fd 100644
--- a/ltablib.c
+++ b/ltablib.c
@@ -59,8 +59,9 @@ static void checktab (lua_State *L, int arg, int what) {
59 59
60 60
61static int tinsert (lua_State *L) { 61static int tinsert (lua_State *L) {
62 lua_Integer e = aux_getn(L, 1, TAB_RW) + 1; /* first empty element */
63 lua_Integer pos; /* where to insert new element */ 62 lua_Integer pos; /* where to insert new element */
63 lua_Integer e = aux_getn(L, 1, TAB_RW);
64 e = luaL_intop(+, e, 1); /* first empty element */
64 switch (lua_gettop(L)) { 65 switch (lua_gettop(L)) {
65 case 2: { /* called with only 2 arguments */ 66 case 2: { /* called with only 2 arguments */
66 pos = e; /* insert new element at the end */ 67 pos = e; /* insert new element at the end */