mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-02-11 09:42:17 +01:00
util: Avoid invalid integer negation in FormatMoney: make FormatMoney(const CAmount& n) well-defined also when n is std::numeric_limits<CAmount>::min()
This commit is contained in:
@@ -84,8 +84,7 @@ FUZZ_TARGET_INIT(integer, initialize_integer)
|
||||
(void)DecompressAmount(u64);
|
||||
(void)FormatISO8601Date(i64);
|
||||
(void)FormatISO8601DateTime(i64);
|
||||
// FormatMoney(i) not defined when i == std::numeric_limits<int64_t>::min()
|
||||
if (i64 != std::numeric_limits<int64_t>::min()) {
|
||||
{
|
||||
int64_t parsed_money;
|
||||
if (ParseMoney(FormatMoney(i64), parsed_money)) {
|
||||
assert(parsed_money == i64);
|
||||
|
||||
Reference in New Issue
Block a user