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 <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2019-05-25 17:03:38 +09:30
parent fae593c448
commit c091a4ee40
1 changed files with 1 additions and 0 deletions

View File

@ -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",