diff options
| author | practicalswift <[email protected]> | 2018-10-26 18:54:30 +0200 |
|---|---|---|
| committer | practicalswift <[email protected]> | 2018-10-26 19:42:58 +0200 |
| commit | 15db77f4dd7f1a7963398f1576580b577a1697bc (patch) | |
| tree | 0414a87045cbdf0618c23534da58f010d62a8808 /src/base58.cpp | |
| parent | Merge #13515: travis: Enable qt for all jobs (diff) | |
| download | discoin-15db77f4dd7f1a7963398f1576580b577a1697bc.tar.xz discoin-15db77f4dd7f1a7963398f1576580b577a1697bc.zip | |
Don't rely on locale dependent functions in base_blob<BITS>::SetHex(...) (uint256), DecodeBase58(...), ParseMoney(...) and ParseHex(...)
Diffstat (limited to 'src/base58.cpp')
| -rw-r--r-- | src/base58.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/base58.cpp b/src/base58.cpp index 7020c2405..eac763394 100644 --- a/src/base58.cpp +++ b/src/base58.cpp @@ -6,6 +6,7 @@ #include <hash.h> #include <uint256.h> +#include <utilstrencodings.h> #include <assert.h> #include <string.h> @@ -34,7 +35,7 @@ static const int8_t mapBase58[256] = { bool DecodeBase58(const char* psz, std::vector<unsigned char>& vch) { // Skip leading spaces. - while (*psz && isspace(*psz)) + while (*psz && IsSpace(*psz)) psz++; // Skip and count leading '1's. int zeroes = 0; @@ -48,7 +49,7 @@ bool DecodeBase58(const char* psz, std::vector<unsigned char>& vch) std::vector<unsigned char> b256(size); // Process the characters. static_assert(sizeof(mapBase58)/sizeof(mapBase58[0]) == 256, "mapBase58.size() should be 256"); // guarantee not out of range - while (*psz && !isspace(*psz)) { + while (*psz && !IsSpace(*psz)) { // Decode base58 character int carry = mapBase58[(uint8_t)*psz]; if (carry == -1) // Invalid b58 character @@ -64,7 +65,7 @@ bool DecodeBase58(const char* psz, std::vector<unsigned char>& vch) psz++; } // Skip trailing spaces. - while (isspace(*psz)) + while (IsSpace(*psz)) psz++; if (*psz != 0) return false; |