mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 21:35:11 +01:00
Remove redundant assignments
This commit is contained in:
parent
280c0e53ef
commit
db362e2e23
@ -107,18 +107,12 @@ bool parse_wireaddr(const char *arg, struct wireaddr *addr, u16 defport)
|
||||
|
||||
// NOTE: arg is assumed to be an ipv4/6 addr string with optional port
|
||||
bool parse_ip_port(tal_t *ctx, const char *arg, char **ip, u16 *port) {
|
||||
bool ipv6, has_brackets, has_colon;
|
||||
|
||||
*port = 0;
|
||||
ipv6 = true;
|
||||
has_brackets = false;
|
||||
has_colon = false;
|
||||
|
||||
*ip = tal_strdup(ctx, arg);
|
||||
|
||||
ipv6 = strchr(*ip, '.') == NULL;
|
||||
has_brackets = strchr(*ip, '[');
|
||||
has_colon = strchr(*ip, ':');
|
||||
bool ipv6 = strchr(*ip, '.') == NULL;
|
||||
bool has_brackets = strchr(*ip, '[');
|
||||
bool has_colon = strchr(*ip, ':');
|
||||
|
||||
// we have an ip addr with no port
|
||||
if ((ipv6 && !has_brackets) || (!ipv6 && !has_colon))
|
||||
|
Loading…
Reference in New Issue
Block a user