mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-19 13:27:35 +02:00
Don't rely on locale dependent functions in base_blob<BITS>::SetHex(...) (uint256), DecodeBase58(...), ParseMoney(...) and ParseHex(...)
This commit is contained in:
parent
f4e4ea1cee
commit
15db77f4dd
6 changed files with 25 additions and 13 deletions
|
|
@ -41,7 +41,7 @@ bool ParseMoney(const char* pszIn, CAmount& nRet)
|
|||
std::string strWhole;
|
||||
int64_t nUnits = 0;
|
||||
const char* p = pszIn;
|
||||
while (isspace(*p))
|
||||
while (IsSpace(*p))
|
||||
p++;
|
||||
for (; *p; p++)
|
||||
{
|
||||
|
|
@ -56,14 +56,14 @@ bool ParseMoney(const char* pszIn, CAmount& nRet)
|
|||
}
|
||||
break;
|
||||
}
|
||||
if (isspace(*p))
|
||||
if (IsSpace(*p))
|
||||
break;
|
||||
if (!isdigit(*p))
|
||||
return false;
|
||||
strWhole.insert(strWhole.end(), *p);
|
||||
}
|
||||
for (; *p; p++)
|
||||
if (!isspace(*p))
|
||||
if (!IsSpace(*p))
|
||||
return false;
|
||||
if (strWhole.size() > 10) // guard against 63 bit overflow
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue