mirror of
https://github.com/aljazceru/lightning.git
synced 2026-02-06 14:44:22 +01:00
wireaddr: correctly parse ':portnum' (meaning IPv4 and IPv6)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Christian Decker
parent
f1df9dfa4d
commit
17f7f50814
@@ -268,9 +268,8 @@ static bool separate_address_and_port(const tal_t *ctx, const char *arg,
|
||||
portcolon = strchr(arg, ':');
|
||||
if (portcolon) {
|
||||
/* Disregard if there's more than one : or if it's at
|
||||
the start or end */
|
||||
the end */
|
||||
if (portcolon != strrchr(arg, ':')
|
||||
|| portcolon == arg
|
||||
|| portcolon[1] == '\0')
|
||||
portcolon = NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user