forked from Juniper/contrail-third-party
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rapidjson_patch1.diff
26 lines (25 loc) · 1.27 KB
/
rapidjson_patch1.diff
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
diff --git a/third_party/rapidjson/include/rapidjson/reader.h b/third_party/rapidjson/include/rapidjson/reader.h
index cb3e826..f270077 100644
--- a/third_party/rapidjson/include/rapidjson/reader.h
+++ b/third_party/rapidjson/include/rapidjson/reader.h
@@ -419,7 +419,7 @@ private:
Ch c = s.Take();
if (c == '\\') { // Escape
Ch e = s.Take();
- if ((sizeof(Ch) == 1 || e < 256) && escape[(unsigned char)e])
+ if ((sizeof(Ch) == 1 || static_cast<unsigned int>(e) < 256) && escape[(unsigned char)e])
RAPIDJSON_PUT(escape[(unsigned char)e]);
else if (e == 'u') { // Unicode
unsigned codepoint = ParseHex4(s);
diff --git a/third_party/rapidjson/include/rapidjson/writer.h b/third_party/rapidjson/include/rapidjson/writer.h
index 9d674b7..ada42a4 100644
--- a/third_party/rapidjson/include/rapidjson/writer.h
+++ b/third_party/rapidjson/include/rapidjson/writer.h
@@ -185,7 +185,7 @@ protected:
stream_.Put('\"');
for (const Ch* p = str; p != str + length; ++p) {
- if ((sizeof(Ch) == 1 || *p < 256) && escape[(unsigned char)*p]) {
+ if ((sizeof(Ch) == 1 || static_cast<unsigned int>(*p) < 256) && escape[(unsigned char)*p]) {
stream_.Put('\\');
stream_.Put(escape[(unsigned char)*p]);
if (escape[(unsigned char)*p] == 'u') {