diff options
author | Max Kellermann <max@duempel.org> | 2008-08-28 20:23:22 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-08-28 20:23:22 +0200 |
commit | 08c9de7b68c8677415ca7b4b60f9a1a16c275ab6 (patch) | |
tree | af4d1d53cb53652a0f3dc53de0243fabcd152c00 /src/client.c | |
parent | 4e17ab11a8cdaa8082059225d5adbe2646f617c1 (diff) | |
download | mpd-08c9de7b68c8677415ca7b4b60f9a1a16c275ab6.tar.gz mpd-08c9de7b68c8677415ca7b4b60f9a1a16c275ab6.tar.xz mpd-08c9de7b68c8677415ca7b4b60f9a1a16c275ab6.zip |
client: more assertions
Diffstat (limited to '')
-rw-r--r-- | src/client.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/client.c b/src/client.c index 6188de7bf..5981cd73d 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; @@ -635,6 +637,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; @@ -718,6 +722,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; @@ -743,6 +748,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) { |