mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-06-02 03:02:35 +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",
|
"-rpcport",
|
||||||
}) {
|
}) {
|
||||||
if (const auto port{args.GetArg(port_option)}) {
|
if (const auto port{args.GetArg(port_option)}) {
|
||||||
uint16_t n;
|
const auto n{ToIntegral<uint16_t>(*port)};
|
||||||
if (!ParseUInt16(*port, &n) || n == 0) {
|
if (!n || *n == 0) {
|
||||||
return InitError(InvalidPortErrMsg(port_option, *port));
|
return InitError(InvalidPortErrMsg(port_option, *port));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user