mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 06:58:57 +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:
@@ -25,13 +25,13 @@ FUZZ_TARGET(parse_numbers)
|
||||
|
||||
int32_t i32;
|
||||
(void)ParseInt32(random_string, &i32);
|
||||
(void)atoi(random_string);
|
||||
(void)LocaleIndependentAtoi<int>(random_string);
|
||||
|
||||
uint32_t u32;
|
||||
(void)ParseUInt32(random_string, &u32);
|
||||
|
||||
int64_t i64;
|
||||
(void)atoi64(random_string);
|
||||
(void)LocaleIndependentAtoi<int64_t>(random_string);
|
||||
(void)ParseFixedPoint(random_string, 3, &i64);
|
||||
(void)ParseInt64(random_string, &i64);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user