Package: libjsoncpp / 0.6.0~rc2-3.1

value-as-String.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
From: Matthew Bekkema <mbekkema97@gmail.com>
Date: Mon, 17 Nov 2014 18:59:47 +0100
Subject: value as String

Fix return value of integers. Already fixed in the latest upstream version.
This also fixes a Minetest crash when browsing the public serverlist.
https://bugs.debian.org/733974

Bug: https://bugs.debian.org/753560
Forwarded: not-needed

---
 src/lib_json/json_value.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/lib_json/json_value.cpp b/src/lib_json/json_value.cpp
index ff98f63..7151181 100644
--- a/src/lib_json/json_value.cpp
+++ b/src/lib_json/json_value.cpp
@@ -666,6 +666,7 @@ Value::asString() const
    case booleanValue:
       return value_.bool_ ? "true" : "false";
    case intValue:
+      return valueToString( value_.int_ );
    case uintValue:
    case realValue:
    case arrayValue:
@@ -1423,14 +1424,14 @@ Value::isString() const
 bool 
 Value::isArray() const
 {
-   return type_ == nullValue  ||  type_ == arrayValue;
+   return type_ == arrayValue;
 }
 
 
 bool 
 Value::isObject() const
 {
-   return type_ == nullValue  ||  type_ == objectValue;
+   return type_ == objectValue;
 }