diff options
Diffstat (limited to 'lua_cjson.c')
-rw-r--r-- | lua_cjson.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lua_cjson.c b/lua_cjson.c index 4b1915a..b46e915 100644 --- a/lua_cjson.c +++ b/lua_cjson.c | |||
@@ -501,7 +501,7 @@ static int lua_array_length(lua_State *l, json_config_t *cfg) | |||
501 | /* table, startkey */ | 501 | /* table, startkey */ |
502 | while (lua_next(l, -2) != 0) { | 502 | while (lua_next(l, -2) != 0) { |
503 | /* table, key, value */ | 503 | /* table, key, value */ |
504 | if (lua_isnumber(l, -2) && | 504 | if (lua_type(l, -2) == LUA_TNUMBER && |
505 | (k = lua_tonumber(l, -2))) { | 505 | (k = lua_tonumber(l, -2))) { |
506 | /* Integer >= 1 ? */ | 506 | /* Integer >= 1 ? */ |
507 | if (floor(k) == k && k >= 1) { | 507 | if (floor(k) == k && k >= 1) { |