Skip to content

Commit fa89652

Browse files
author
MarcoFalke
committed
init: Reject + sign in -*port parsing
It would be confusing to specify the sign for an unsigned value here, so reject it.
1 parent fa9c455 commit fa89652

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/init.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1179,8 +1179,8 @@ bool CheckHostPortOptions(const ArgsManager& args) {
11791179
"-rpcport",
11801180
}) {
11811181
if (const auto port{args.GetArg(port_option)}) {
1182-
uint16_t n;
1183-
if (!ParseUInt16(*port, &n) || n == 0) {
1182+
const auto n{ToIntegral<uint16_t>(*port)};
1183+
if (!n || *n == 0) {
11841184
return InitError(InvalidPortErrMsg(port_option, *port));
11851185
}
11861186
}

0 commit comments

Comments
 (0)