mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 06:28:31 +01:00
Replace use of locale dependent atoi(…) with locale-independent std::from_chars(…) (C++17)
test: Add test cases for LocaleIndependentAtoi fuzz: Assert legacy atoi(s) == LocaleIndependentAtoi<int>(s) fuzz: Assert legacy atoi64(s) == LocaleIndependentAtoi<int64_t>(s)
This commit is contained in:
@@ -69,7 +69,7 @@ CScript ParseScript(const std::string& s)
|
||||
(w->front() == '-' && w->size() > 1 && std::all_of(w->begin()+1, w->end(), ::IsDigit)))
|
||||
{
|
||||
// Number
|
||||
int64_t n = atoi64(*w);
|
||||
int64_t n = LocaleIndependentAtoi<int64_t>(*w);
|
||||
|
||||
//limit the range of numbers ParseScript accepts in decimal
|
||||
//since numbers outside -0xFFFFFFFF...0xFFFFFFFF are illegal in scripts
|
||||
|
||||
Reference in New Issue
Block a user