mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-05-31 18:22:04 +02:00
init: Reject + sign in -*port parsing
It would be confusing to specify the sign for an unsigned value here, so reject it.
This commit is contained in:
parent
fa9c45577d
commit
fa89652e68
@ -1179,8 +1179,8 @@ bool CheckHostPortOptions(const ArgsManager& args) {
|
||||
"-rpcport",
|
||||
}) {
|
||||
if (const auto port{args.GetArg(port_option)}) {
|
||||
uint16_t n;
|
||||
if (!ParseUInt16(*port, &n) || n == 0) {
|
||||
const auto n{ToIntegral<uint16_t>(*port)};
|
||||
if (!n || *n == 0) {
|
||||
return InitError(InvalidPortErrMsg(port_option, *port));
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user