diff options
author | Samuel Dobson <dobsonsa68@gmail.com> | 2021-10-12 15:19:00 +1300 |
---|---|---|
committer | Samuel Dobson <dobsonsa68@gmail.com> | 2021-10-12 15:32:11 +1300 |
commit | fbbbc594ad2f57969cd49d116f68547856d51359 (patch) | |
tree | 42b2efeb40631dabc69225d170ca2fb31f50a87f /src/util | |
parent | e418a8e675e4dbca9f9c3cf7dd4633aa3c6c196e (diff) | |
parent | fa43e7c2d9dc5e2df70acd2019bdd24023c1d333 (diff) | |
download | bitcoin-fbbbc594ad2f57969cd49d116f68547856d51359.tar.xz |
Merge bitcoin/bitcoin#23227: bitcoin-tx: Avoid treating integer overflow as OP_0
fa43e7c2d9dc5e2df70acd2019bdd24023c1d333 bitcoin-tx: Avoid treating overflow as OP_0 (MarcoFalke)
fa053c0019bc8b2174c485f4885f894f2b5de472 style: Fix whitespace in Parse* functions (MarcoFalke)
fa03dec7e98bdda8aa596ef7943cf0a8d0bcb127 refactor: Use C++11 range based for loop in ParseScript (MarcoFalke)
fad55e79ca18a5894a8da6db6309c323eecbb178 doc: Fixup ToIntegral docs (MarcoFalke)
Pull request description:
Seems odd to treat integer overflow as `OP_0`, so fix that.
ACKs for top commit:
theStack:
re-ACK fa43e7c2d9dc5e2df70acd2019bdd24023c1d333
shaavan:
ACK fa43e7c2d9dc5e2df70acd2019bdd24023c1d333
Tree-SHA512: 1bbe2de62d853badc18d57d169c6e78ddcdff037e5a85357995dead11c8e67a4fe35087e08a181c60753f8ce91058b7fcc06f5b7901afedc78fbacea8bc3ef4f
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/strencodings.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/util/strencodings.h b/src/util/strencodings.h index 1f7762aeef..eedb5ec2f8 100644 --- a/src/util/strencodings.h +++ b/src/util/strencodings.h @@ -72,7 +72,7 @@ void SplitHostPort(std::string in, uint16_t& portOut, std::string& hostOut); // LocaleIndependentAtoi is provided for backwards compatibility reasons. // -// New code should use the ParseInt64/ParseUInt64/ParseInt32/ParseUInt32 functions +// New code should use ToIntegral or the ParseInt* functions // which provide parse error feedback. // // The goal of LocaleIndependentAtoi is to replicate the exact defined behaviour @@ -125,7 +125,7 @@ constexpr inline bool IsSpace(char c) noexcept { /** * Convert string to integral type T. Leading whitespace, a leading +, or any * trailing character fail the parsing. The required format expressed as regex - * is `-?[0-9]+`. + * is `-?[0-9]+`. The minus sign is only permitted for signed integer types. * * @returns std::nullopt if the entire string could not be parsed, or if the * parsed value is not in the range representable by the type T. |