mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-04 10:12:28 +02:00
Merge bitcoin/bitcoin#32520: Remove legacy Parse(U)Int*
faf55fc80bdoc: Remove ParseInt mentions in documentation (MarcoFalke)3333282933refactor: Remove unused Parse(U)Int* (MarcoFalke)fa84e6c36cbitcoin-tx: Reject + sign in MutateTxDel* (MarcoFalke)face2519fabitcoin-tx: Reject + sign in vout parsing (MarcoFalke)fa8acaf0b9bitcoin-tx: Reject + sign in replaceable parsing (MarcoFalke)faff25a558bitcoin-tx: Reject + sign in locktime (MarcoFalke)dddd9e5fe3bitcoin-tx: Reject + sign in nversion parsing (MarcoFalke)fab06ac037rest: Use SAFE_CHARS_URI in SanitizeString error msg (MarcoFalke)8888bb499drest: Reject + sign in /blockhashbyheight/ (MarcoFalke)fafd43c691test: Reject + sign when parsing regtest deployment params (MarcoFalke)fa123afa0eReject + sign when checking -ipcfd (MarcoFalke)fa479857edReject + sign in SplitHostPort (MarcoFalke)fab4c2967dnet: Reject + sign when parsing subnet mask (MarcoFalke)fa89652e68init: Reject + sign in -*port parsing (MarcoFalke)fa9c45577dcli: Reject + sign in -netinfo level parsing (MarcoFalke)fa98041325refactor: Use ToIntegral in CreateFromDump (MarcoFalke)fa23ed7fc2refactor: Use ToIntegral in ParseHDKeypath (MarcoFalke) Pull request description: The legacy int parsing is problematic, because it accepts the `+` sign for unsigned integers. In all cases this is either: * Useless, because the `+` sign was already rejected. * Erroneous and inconsistent, when third party parsers reject it. (C.f. https://github.com/bitcoin/bitcoin/pull/32365) * Confusing, because the `+` sign is neither documented, nor can it be assumed to be present. Fix all issues by removing the legacy int parsing. ACKs for top commit: stickies-v: re-ACKfaf55fc80bbrunoerg: code review ACKfaf55fc80bTree-SHA512: a311ab6a58fe02a37741c1800feb3dcfad92377b4bfb61b433b2393f52ba89ef45d00940972b2767b213a3dd7b59e5e35d5b659c586eacdfe4e565a77b12b19f
This commit is contained in:
@@ -1009,10 +1009,6 @@ Strings and formatting
|
||||
buffer overflows, and surprises with `\0` characters. Also, some C string manipulations
|
||||
tend to act differently depending on platform, or even the user locale.
|
||||
|
||||
- Use `ToIntegral` from [`strencodings.h`](/src/util/strencodings.h) for number parsing. In legacy code you might also find `ParseInt*` family of functions, `ParseDouble` or `LocaleIndependentAtoi`.
|
||||
|
||||
- *Rationale*: These functions do overflow checking and avoid pesky locale issues.
|
||||
|
||||
- For `strprintf`, `LogInfo`, `LogDebug`, etc formatting characters don't need size specifiers.
|
||||
|
||||
- *Rationale*: Bitcoin Core uses tinyformat, which is type safe. Leave them out to avoid confusion.
|
||||
|
||||
Reference in New Issue
Block a user