From e07c774a1dbf4055fcf4e21e554c7a216a5e569a Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Fri, 7 Aug 2020 23:54:36 -0300 Subject: [PATCH] Fix maybe-uninitialized warnings in slirp/socket.c --- src/network/slirp/socket.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/network/slirp/socket.c b/src/network/slirp/socket.c index 81a499f18..36d005192 100644 --- a/src/network/slirp/socket.c +++ b/src/network/slirp/socket.c @@ -167,10 +167,10 @@ size_t sopreprbuf(struct socket *so, struct iovec *iov, int *np) */ int soread(struct socket *so) { - int n, nn; + int n = 0, nn; size_t buf_len; struct sbuf *sb = &so->so_snd; - struct iovec iov[2]; + struct iovec iov[2] = {{0, 0}, {0, 0}}; DEBUG_CALL("soread"); DEBUG_ARG("so = %p", so); @@ -248,7 +248,7 @@ int soreadbuf(struct socket *so, const char *buf, int size) { int n, nn, copy = size; struct sbuf *sb = &so->so_snd; - struct iovec iov[2]; + struct iovec iov[2] = {{0, 0}, {0, 0}}; DEBUG_CALL("soreadbuf"); DEBUG_ARG("so = %p", so); @@ -396,7 +396,7 @@ int sowrite(struct socket *so) int n, nn; struct sbuf *sb = &so->so_rcv; int len = sb->sb_cc; - struct iovec iov[2]; + struct iovec iov[2] = {{0, 0}, {0, 0}}; DEBUG_CALL("sowrite"); DEBUG_ARG("so = %p", so);