aboutsummaryrefslogtreecommitdiff
path: root/src/node
diff options
context:
space:
mode:
authorpracticalswift <practicalswift@users.noreply.github.com>2021-09-30 14:18:50 +0000
committerpracticalswift <practicalswift@users.noreply.github.com>2021-09-30 14:21:17 +0000
commit4343f114cc661cf031ec915538c11b9b030e2e15 (patch)
tree0b0cc9ec8fbea9cc65490dd2ae437478b78c3a72 /src/node
parent2d8e0c0c3c0d3c4cee7bb52d1edf501f40c53463 (diff)
downloadbitcoin-4343f114cc661cf031ec915538c11b9b030e2e15.tar.xz
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)
Diffstat (limited to 'src/node')
-rw-r--r--src/node/blockstorage.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/node/blockstorage.cpp b/src/node/blockstorage.cpp
index 5ddcf95c84..104fe8bf01 100644
--- a/src/node/blockstorage.cpp
+++ b/src/node/blockstorage.cpp
@@ -85,7 +85,7 @@ void CleanupBlockRevFiles()
// start removing block files.
int nContigCounter = 0;
for (const std::pair<const std::string, fs::path>& item : mapBlockFiles) {
- if (atoi(item.first) == nContigCounter) {
+ if (LocaleIndependentAtoi<int>(item.first) == nContigCounter) {
nContigCounter++;
continue;
}