From c091a4ee40c8d4dd7a3899bcbbf5201229e8b93d Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Sat, 25 May 2019 17:03:38 +0930 Subject: [PATCH] gossipd: fix spurious gcc warning. It turns out that we don't look at type when we return 0, but gcc isn't quite smart enough for that. Initializing to -1 is good practice anyway for the failure path. Signed-off-by: Rusty Russell --- gossipd/gossip_store.c | 1 + 1 file changed, 1 insertion(+) diff --git a/gossipd/gossip_store.c b/gossipd/gossip_store.c index 1d71bca9d..ad9a9489e 100644 --- a/gossipd/gossip_store.c +++ b/gossipd/gossip_store.c @@ -300,6 +300,7 @@ static size_t transfer_store_msg(int from_fd, size_t from_off, int to_fd, const u8 *p; size_t tmplen; + *type = -1; if (pread(from_fd, hdr, sizeof(hdr), from_off) != sizeof(hdr)) { status_broken("Failed reading header from to gossip store @%zu" ": %s",