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:
1 parent
2d8e0c0c3c
commit
4343f114cc
15 files changed
+145
-52
No files matched your search
@@ -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