Browse Source

Update use_json_object_new_int64.patch

garypang13 4 years ago
parent
commit
81f39dbaa7
1 changed files with 6 additions and 18 deletions
  1. 6 18
      devices/common/patches/use_json_object_new_int64.patch

+ 6 - 18
devices/common/patches/use_json_object_new_int64.patch

@@ -1,29 +1,17 @@
-From 3af274ad9e230907a9b74f9cd9832bc1879bbaa8 Mon Sep 17 00:00:00 2001
-From: garypang13 <[email protected]>
-Date: Sun, 15 Nov 2020 17:31:03 +0800
-Subject: [PATCH] Update jsonc.c
-
----
- libs/luci-lib-jsonc/src/jsonc.c | 10 ++++------
- 1 file changed, 4 insertions(+), 6 deletions(-)
-
-diff --git a/libs/luci-lib-jsonc/src/jsonc.c b/libs/luci-lib-jsonc/src/jsonc.c
-index 2f56a4a688..aedd082d71 100644
---- a/package/feeds/luci/luci-lib-jsonc/src/jsonc.c
+-- a/package/feeds/luci/luci-lib-jsonc/src/jsonc.c
 +++ b/package/feeds/luci/luci-lib-jsonc/src/jsonc.c
 +++ b/package/feeds/luci/luci-lib-jsonc/src/jsonc.c
-@@ -366,10 +366,9 @@
+--- 
++++ 
+@@ -366,9 +366,7 @@
  	case LUA_TNUMBER:
  	case LUA_TNUMBER:
  		nd = lua_tonumber(L, index);
  		nd = lua_tonumber(L, index);
 -		ni = lua_tointeger(L, index);
 -		ni = lua_tointeger(L, index);
 -
 -
 -		if (nd == ni)
 -		if (nd == ni)
--			return json_object_new_int64(nd);
+-			return json_object_new_int(nd);
 -
 -
--		return json_object_new_double(nd);
-+
 +		if(nd >= INT64_MIN && nd <= INT64_MAX)
 +		if(nd >= INT64_MIN && nd <= INT64_MAX)
 +			return json_object_new_int64(nd);
 +			return json_object_new_int64(nd);
 +		else
 +		else
-+			return json_object_new_double(nd);
+ 		return json_object_new_double(nd);
  
  
- 	case LUA_TSTRING: