aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-08-28 20:23:22 +0200
committerEric Wong <normalperson@yhbt.net>2008-09-01 18:35:19 -0700
commit557679eba7e6daae37e90c645b1e69174fb1456c (patch)
treeb5608dbb783531cbe90b080dcb88b46d79dcd72f /src
parent692cfc5c36ddff07888d1c2e7ecefda8be8ead47 (diff)
downloadmpd-557679eba7e6daae37e90c645b1e69174fb1456c.tar.gz
mpd-557679eba7e6daae37e90c645b1e69174fb1456c.tar.xz
mpd-557679eba7e6daae37e90c645b1e69174fb1456c.zip
client: more assertions
Diffstat (limited to 'src')
-rw-r--r--src/client.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/client.c b/src/client.c
index f34d64b88..51f3e8e3b 100644
--- a/src/client.c
+++ b/src/client.c
@@ -146,6 +146,8 @@ static void client_init(struct client *client, int fd)
{
static unsigned int next_client_num;
+ assert(fd >= 0);
+
client->cmd_list_size = 0;
client->cmd_list_dup = 0;
client->cmd_list_OK = -1;
@@ -632,6 +634,8 @@ static void client_write_deferred(struct client *client)
buf = client->deferred_send;
while (buf) {
+ assert(buf->size > 0);
+
ret = write(client->fd, buf->data, buf->size);
if (ret < 0)
break;
@@ -715,6 +719,7 @@ static void client_defer_output(struct client *client,
{
struct sllnode **buf_r;
+ assert(length > 0);
assert(client->deferred_send != NULL);
client->deferred_bytes += sizeof(struct sllnode) + length;
@@ -740,6 +745,7 @@ static void client_write(struct client *client,
{
ssize_t ret;
+ assert(length > 0);
assert(client->deferred_send == NULL);
if ((ret = write(client->fd, data, length)) < 0) {