diff options
| author | Wladimir J. van der Laan <[email protected]> | 2012-04-20 10:18:45 -0700 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2012-04-20 10:18:45 -0700 |
| commit | 00b9c0f4b20f6eb714fa55eb00df326a6f74fd10 (patch) | |
| tree | 09d89fa8f0111990b95860b440b0030a1eca29ae /src/util.cpp | |
| parent | Merge pull request #959 from rebroad/LoadBlockIndexKillable (diff) | |
| parent | Fix bugs on 'unsigned char' platforms. (diff) | |
| download | discoin-00b9c0f4b20f6eb714fa55eb00df326a6f74fd10.tar.xz discoin-00b9c0f4b20f6eb714fa55eb00df326a6f74fd10.zip | |
Merge pull request #1122 from dlitz/unsigned-char-fix
Unsigned char fix & fix undefined phexdigits[255]
Diffstat (limited to 'src/util.cpp')
| -rw-r--r-- | src/util.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/util.cpp b/src/util.cpp index ac65d417b..9f2de3449 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -425,14 +425,14 @@ bool ParseMoney(const char* pszIn, int64& nRet) } -static char phexdigit[256] = +static signed char phexdigit[256] = { -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 0,1,2,3,4,5,6,7,8,9,-1,-1,-1,-1,-1,-1, -1,0xa,0xb,0xc,0xd,0xe,0xf,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, - -1,0xa,0xb,0xc,0xd,0xe,0xf,-1,-1,-1,-1,-1,-1,-1,-1,-1 + -1,0xa,0xb,0xc,0xd,0xe,0xf,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, @@ -461,12 +461,12 @@ vector<unsigned char> ParseHex(const char* psz) { while (isspace(*psz)) psz++; - char c = phexdigit[(unsigned char)*psz++]; - if (c == (char)-1) + signed char c = phexdigit[(unsigned char)*psz++]; + if (c == (signed char)-1) break; unsigned char n = (c << 4); c = phexdigit[(unsigned char)*psz++]; - if (c == (char)-1) + if (c == (signed char)-1) break; n |= c; vch.push_back(n); |