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:
1 file changed
+2
-2
+2
-2
@@ -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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user