From f59de2770db9e2803d7dff6330e490479f44f419 Mon Sep 17 00:00:00 2001 From: Alexandre Ratchov Date: Wed, 5 Mar 2014 20:09:34 +0100 Subject: [PATCH] check if writable preparing a DATA packet --- sndiod/sock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sndiod/sock.c b/sndiod/sock.c index c413586..61ea320 100644 --- a/sndiod/sock.c +++ b/sndiod/sock.c @@ -1416,7 +1416,7 @@ sock_buildmsg(struct sock *f) /* * If data available, build a DATA message. */ - if (f->slot != NULL && f->slot->sub.buf.used > 0 && f->wmax > 0) { + if (f->slot != NULL && f->wmax > 0 && f->slot->sub.buf.used > 0) { size = f->slot->sub.buf.used; if (size > AMSG_DATAMAX) size = AMSG_DATAMAX;