aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/transaction.h
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/wallet/transaction.h
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/wallet/transaction.h')
-rw-r--r--src/wallet/transaction.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/wallet/transaction.h b/src/wallet/transaction.h
index 0cd91b9ebe..223901586e 100644
--- a/src/wallet/transaction.h
+++ b/src/wallet/transaction.h
@@ -216,9 +216,9 @@ public:
}
const auto it_op = mapValue.find("n");
- nOrderPos = (it_op != mapValue.end()) ? atoi64(it_op->second) : -1;
+ nOrderPos = (it_op != mapValue.end()) ? LocaleIndependentAtoi<int64_t>(it_op->second) : -1;
const auto it_ts = mapValue.find("timesmart");
- nTimeSmart = (it_ts != mapValue.end()) ? static_cast<unsigned int>(atoi64(it_ts->second)) : 0;
+ nTimeSmart = (it_ts != mapValue.end()) ? static_cast<unsigned int>(LocaleIndependentAtoi<int64_t>(it_ts->second)) : 0;
mapValue.erase("fromaccount");
mapValue.erase("spent");