mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-24 13:59:38 +02: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:
@@ -250,7 +250,7 @@ bool RPCConsole::RPCParseCommandLine(interfaces::Node* node, std::string &strRes
|
||||
for(char argch: curarg)
|
||||
if (!IsDigit(argch))
|
||||
throw std::runtime_error("Invalid result query");
|
||||
subelement = lastResult[atoi(curarg.c_str())];
|
||||
subelement = lastResult[LocaleIndependentAtoi<int>(curarg)];
|
||||
}
|
||||
else if (lastResult.isObject())
|
||||
subelement = find_value(lastResult, curarg);
|
||||
|
||||
Reference in New Issue
Block a user