aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2020-04-15 08:01:28 +0200
committerGitHub <noreply@github.com>2020-04-15 08:01:28 +0200
commit8ae8c1600a66c724565ce7a70e0e5f542f12e38e (patch)
tree8a9cc2ec6ce510b5cbc6d894adb80fb69fa7ba5b
parent5c588f89e79e02cba392abe3d00688772321f88b (diff)
downloadminetest-8ae8c1600a66c724565ce7a70e0e5f542f12e38e.tar.gz
minetest-8ae8c1600a66c724565ce7a70e0e5f542f12e38e.tar.bz2
minetest-8ae8c1600a66c724565ce7a70e0e5f542f12e38e.zip
Fix parsing JSON with large integers (#9674)
-rw-r--r--src/script/common/c_content.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/script/common/c_content.cpp b/src/script/common/c_content.cpp
index d73ecedab..25dada757 100644
--- a/src/script/common/c_content.cpp
+++ b/src/script/common/c_content.cpp
@@ -1671,10 +1671,10 @@ static bool push_json_value_helper(lua_State *L, const Json::Value &value,
lua_pushvalue(L, nullindex);
break;
case Json::intValue:
- lua_pushinteger(L, value.asInt());
+ lua_pushinteger(L, value.asLargestInt());
break;
case Json::uintValue:
- lua_pushinteger(L, value.asUInt());
+ lua_pushinteger(L, value.asLargestUInt());
break;
case Json::realValue:
lua_pushnumber(L, value.asDouble());
@@ -1700,7 +1700,7 @@ static bool push_json_value_helper(lua_State *L, const Json::Value &value,
lua_createtable(L, 0, value.size());
for (Json::Value::const_iterator it = value.begin();
it != value.end(); ++it) {
-#ifndef JSONCPP_STRING
+#if !defined(JSONCPP_STRING) && (JSONCPP_VERSION_MAJOR < 1 || JSONCPP_VERSION_MINOR < 9)
const char *str = it.memberName();
lua_pushstring(L, str ? str : "");
#else