aboutsummaryrefslogtreecommitdiff
path: root/lbaselib.c
diff options
context:
space:
mode:
Diffstat (limited to 'lbaselib.c')
-rw-r--r--lbaselib.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lbaselib.c b/lbaselib.c
index 419fdc52..80b0039d 100644
--- a/lbaselib.c
+++ b/lbaselib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lbaselib.c,v 1.231 2009/12/11 13:40:44 roberto Exp roberto $ 2** $Id: lbaselib.c,v 1.232 2009/12/15 11:25:16 roberto Exp roberto $
3** Basic library 3** Basic library
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -258,7 +258,7 @@ static int ipairsaux (lua_State *L) {
258 i++; /* next value */ 258 i++; /* next value */
259 lua_pushinteger(L, i); 259 lua_pushinteger(L, i);
260 lua_rawgeti(L, 1, i); 260 lua_rawgeti(L, 1, i);
261 return (lua_isnil(L, -1) && i > (int)lua_objlen(L, 1)) ? 0 : 2; 261 return (lua_isnil(L, -1) && i > luaL_len(L, 1)) ? 0 : 2;
262} 262}
263 263
264 264
@@ -416,7 +416,7 @@ static int luaB_unpack (lua_State *L) {
416 int i, e, n; 416 int i, e, n;
417 luaL_checktype(L, 1, LUA_TTABLE); 417 luaL_checktype(L, 1, LUA_TTABLE);
418 i = luaL_optint(L, 2, 1); 418 i = luaL_optint(L, 2, 1);
419 e = luaL_opt(L, luaL_checkint, 3, (int)lua_objlen(L, 1)); 419 e = luaL_opt(L, luaL_checkint, 3, (int)lua_rawlen(L, 1));
420 if (i > e) return 0; /* empty range */ 420 if (i > e) return 0; /* empty range */
421 n = e - i + 1; /* number of elements */ 421 n = e - i + 1; /* number of elements */
422 if (n <= 0 || !lua_checkstack(L, n)) /* n <= 0 means arith. overflow */ 422 if (n <= 0 || !lua_checkstack(L, n)) /* n <= 0 means arith. overflow */