Skip to content

Commit 2de52ce

Browse files
committed
bugfix: don't use new local var here
1 parent e44f589 commit 2de52ce

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: lualib-src/lua-sharedata.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ lindexconf(lua_State *L) {
540540
if (!lua_isinteger(L, 2)) {
541541
return luaL_error(L, "Invalid key %f", lua_tonumber(L, 2));
542542
}
543-
lua_Integer key = lua_tointeger(L, 2);
543+
key = (int)lua_tointeger(L, 2);
544544
if (key > 0 && key <= tbl->sizearray) {
545545
--key;
546546
pushvalue(L, tbl->L, tbl->arraytype[key], &tbl->array[key]);
@@ -610,7 +610,7 @@ lnextkey(lua_State *L) {
610610
if (!lua_isinteger(L, 2)) {
611611
return 0;
612612
}
613-
lua_Integer key = lua_tointeger(L, 2);
613+
key = (int)lua_tointeger(L, 2);
614614
if (key > 0 && key <= sizearray) {
615615
lua_Integer i;
616616
for (i=key;i<sizearray;i++) {

0 commit comments

Comments
 (0)