Fix maybe-uninitialized warnings in slirp/socket.c

This commit is contained in:
RichardG867
2020-08-07 23:54:36 -03:00
parent 62a2c4a50d
commit e07c774a1d

View File

@@ -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);