aboutsummaryrefslogtreecommitdiff
path: root/lapi.c
diff options
context:
space:
mode:
Diffstat (limited to 'lapi.c')
-rw-r--r--lapi.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lapi.c b/lapi.c
index ec13bb74..faf0fa2c 100644
--- a/lapi.c
+++ b/lapi.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lapi.c,v 1.175 2002/03/04 21:29:41 roberto Exp roberto $ 2** $Id: lapi.c,v 1.176 2002/03/07 18:15:10 roberto Exp roberto $
3** Lua API 3** Lua API
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -597,7 +597,7 @@ LUA_API int lua_getn (lua_State *L, int index) {
597 api_check(L, ttype(t) == LUA_TTABLE); 597 api_check(L, ttype(t) == LUA_TTABLE);
598 value = luaH_getstr(hvalue(t), luaS_newliteral(L, "n")); /* = t.n */ 598 value = luaH_getstr(hvalue(t), luaS_newliteral(L, "n")); /* = t.n */
599 if (ttype(value) == LUA_TNUMBER) 599 if (ttype(value) == LUA_TNUMBER)
600 n = cast(int, nvalue(value)); 600 lua_number2int(n, nvalue(value));
601 else { 601 else {
602 Node *nd; 602 Node *nd;
603 Table *a = hvalue(t); 603 Table *a = hvalue(t);
@@ -618,7 +618,7 @@ LUA_API int lua_getn (lua_State *L, int index) {
618 max = nvalue(key(nd)); 618 max = nvalue(key(nd));
619 nd++; 619 nd++;
620 } 620 }
621 n = cast(int, max); 621 lua_number2int(n, max);
622 } 622 }
623 lua_unlock(L); 623 lua_unlock(L);
624 return n; 624 return n;