mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-03-03 10:46:58 +01:00
build: fix compile error on gcc ~7.3.0
It seems to be having a bit of trouble understanding the control flow to realize it's not actually uninitialized. Add an error handler after the switch in case we miss a real uninitialized error in the future. Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
parent
45b07e7e89
commit
7c4b9c8a0d
1 changed files with 6 additions and 2 deletions
|
@ -150,11 +150,11 @@ int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
struct io_conn *conn = tal(NULL, struct io_conn);
|
struct io_conn *conn = tal(NULL, struct io_conn);
|
||||||
struct wireaddr_internal addr;
|
struct wireaddr_internal addr;
|
||||||
int af;
|
int af = -1;
|
||||||
struct pubkey us, them;
|
struct pubkey us, them;
|
||||||
const char *err_msg;
|
const char *err_msg;
|
||||||
const char *at;
|
const char *at;
|
||||||
struct addrinfo *ai;
|
struct addrinfo *ai = NULL;
|
||||||
|
|
||||||
setup_locale();
|
setup_locale();
|
||||||
secp256k1_ctx = secp256k1_context_create(SECP256K1_CONTEXT_VERIFY |
|
secp256k1_ctx = secp256k1_context_create(SECP256K1_CONTEXT_VERIFY |
|
||||||
|
@ -212,6 +212,10 @@ int main(int argc, char *argv[])
|
||||||
}
|
}
|
||||||
ai = wireaddr_to_addrinfo(tmpctx, &addr.u.wireaddr);
|
ai = wireaddr_to_addrinfo(tmpctx, &addr.u.wireaddr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (af == -1 || ai == NULL)
|
||||||
|
err(1, "Initializing socket");
|
||||||
|
|
||||||
conn->fd = socket(af, SOCK_STREAM, 0);
|
conn->fd = socket(af, SOCK_STREAM, 0);
|
||||||
if (conn->fd < 0)
|
if (conn->fd < 0)
|
||||||
err(1, "Creating socket");
|
err(1, "Creating socket");
|
||||||
|
|
Loading…
Add table
Reference in a new issue