gnu: jsoncpp: Fix test failure on armhf-linux and aarch64-linux.
[jackhill/guix/guix.git] / gnu / packages / patches / jsoncpp-fix-inverted-case.patch
1 This patch fixes a bug and related test failure on platforms where 'char'
2 is unsigned.
3
4 Taken from upstream:
5 https://github.com/open-source-parsers/jsoncpp/commit/f11611c8785082ead760494cba06196f14a06dcb
6
7 diff --git a/src/lib_json/json_writer.cpp b/src/lib_json/json_writer.cpp
8 index 8e06cca2..56195dc1 100644
9 --- a/src/lib_json/json_writer.cpp
10 +++ b/src/lib_json/json_writer.cpp
11 @@ -178,8 +178,9 @@ static bool isAnyCharRequiredQuoting(char const* s, size_t n) {
12
13 char const* const end = s + n;
14 for (char const* cur = s; cur < end; ++cur) {
15 - if (*cur == '\\' || *cur == '\"' || *cur < ' ' ||
16 - static_cast<unsigned char>(*cur) < 0x80)
17 + if (*cur == '\\' || *cur == '\"' ||
18 + static_cast<unsigned char>(*cur) < ' ' ||
19 + static_cast<unsigned char>(*cur) >= 0x80)
20 return true;
21 }
22 return false;