mirror of
https://github.com/coolsnowwolf/luci
synced 2025-01-07 07:06:41 +08:00
jsonc: use json object new int64
This commit is contained in:
parent
2f1c8833d5
commit
50d5286ab3
@ -311,11 +311,9 @@ static struct json_object * _lua_to_json(lua_State *L, int index)
|
||||
|
||||
case LUA_TNUMBER:
|
||||
nd = lua_tonumber(L, index);
|
||||
ni = lua_tointeger(L, index);
|
||||
|
||||
if (nd == ni)
|
||||
return json_object_new_int(nd);
|
||||
|
||||
if(nd >= INT64_MIN && nd <= INT64_MAX)
|
||||
return json_object_new_int64(nd);
|
||||
else
|
||||
return json_object_new_double(nd);
|
||||
|
||||
case LUA_TSTRING:
|
||||
|
Loading…
Reference in New Issue
Block a user