aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2018-10-28 06:48:46 -0400
committerMarcoFalke <falke.marco@gmail.com>2018-10-28 06:49:07 -0400
commitf1e2f2a85962c1664e4e55471061af0eaa798d40 (patch)
tree5d4c9a91453db71570998a96385b4e9090f1e14c /test
parent643b25d093a959b2176a7ace810a7d44267ca2e9 (diff)
parent15db77f4dd7f1a7963398f1576580b577a1697bc (diff)
downloadbitcoin-f1e2f2a85962c1664e4e55471061af0eaa798d40.tar.xz
Merge #14585: refactor: remove usage of locale dependent std::isspace
15db77f4dd Don't rely on locale dependent functions in base_blob<BITS>::SetHex(...) (uint256), DecodeBase58(...), ParseMoney(...) and ParseHex(...) (practicalswift) Pull request description: Don't rely on locale dependent function `std::isspace` in `base_blob<BITS>::SetHex(...)` (uint256), `DecodeBase58(...)`, `ParseMoney(...)` and `ParseHex(...)`. Rationale: ``` $ uname -s Darwin $ cat poc.cpp #include <iostream> #include <locale> int main(void) { setlocale(LC_ALL, ""); std::cout << std::isspace(133) << ' ' << std::isspace(154) << ' ' << std::isspace(160); std::cout << '\n'; } $ clang++ -o poc poc.cpp $ ./poc 1 0 1 $ LC_ALL=en_US ./poc 1 0 1 $ LC_ALL=C ./poc 0 0 0 $ LC_ALL=ru_RU.KOI8-R ./poc # an "interesting" locale 0 1 0 ``` Tree-SHA512: 4eafb267342b8a777da6cca07c353afd1f90f3fc1d91e01f526f1b384a2b97c1da25b7bd7dfc300655182a4eaec6a4bea855a45723ab53c750a734b60e1e3c9f
Diffstat (limited to 'test')
-rwxr-xr-xtest/lint/lint-locale-dependence.sh4
1 files changed, 0 insertions, 4 deletions
diff --git a/test/lint/lint-locale-dependence.sh b/test/lint/lint-locale-dependence.sh
index cbee437c91..216cabbce9 100755
--- a/test/lint/lint-locale-dependence.sh
+++ b/test/lint/lint-locale-dependence.sh
@@ -2,7 +2,6 @@
export LC_ALL=C
KNOWN_VIOLATIONS=(
- "src/base58.cpp:.*isspace"
"src/bitcoin-tx.cpp.*stoul"
"src/bitcoin-tx.cpp.*trim_right"
"src/bitcoin-tx.cpp:.*atoi"
@@ -18,15 +17,12 @@ KNOWN_VIOLATIONS=(
"src/test/getarg_tests.cpp.*split"
"src/torcontrol.cpp:.*atoi"
"src/torcontrol.cpp:.*strtol"
- "src/uint256.cpp:.*isspace"
"src/uint256.cpp:.*tolower"
"src/util.cpp:.*atoi"
"src/util.cpp:.*fprintf"
"src/util.cpp:.*tolower"
"src/utilmoneystr.cpp:.*isdigit"
- "src/utilmoneystr.cpp:.*isspace"
"src/utilstrencodings.cpp:.*atoi"
- "src/utilstrencodings.cpp:.*isspace"
"src/utilstrencodings.cpp:.*strtol"
"src/utilstrencodings.cpp:.*strtoll"
"src/utilstrencodings.cpp:.*strtoul"