fixed some compiler warnings and prevent duplicate assignments
[srvx.git] / src / ioset.c
index a7563d30398e90aca346eddc6b21b3e92a66a293..33622af1c55e39f19a298a2702444163d875b074 100644 (file)
@@ -131,7 +131,7 @@ ioq_grow(struct ioq *ioq) {
     ioq->get = 0;
     ioq->buf = new_buf;
     ioq->size = new_size;
-    return new_size - ioq->put;
+    return new_size - ioq->put - 1;
 }
 
 extern struct io_engine io_engine_kevent;
@@ -439,7 +439,7 @@ ioset_find_line_length(struct io_fd *fd) {
 
 static void
 ioset_buffered_read(struct io_fd *fd) {
-    int put_avail, nbr, fdnum;
+    int put_avail, nbr;
 
     if (!(put_avail = ioq_put_avail(&fd->recv)))
         put_avail = ioq_grow(&fd->recv);
@@ -474,7 +474,6 @@ ioset_buffered_read(struct io_fd *fd) {
         fd->recv.put += nbr;
         if (fd->recv.put == fd->recv.size)
             fd->recv.put = 0;
-        fdnum = fd->fd;
         while (fd->line_len > 0) {
             struct io_fd *old_active;
             int died = 0;