From e85220dd0b149a0dc8bcb1374a9c05ad76417e96 Mon Sep 17 00:00:00 2001 From: Ove Kaaven Date: Sat, 1 May 1999 10:18:21 +0000 Subject: [PATCH] Fixed off-by-one bug in async output buffers. --- misc/comm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/comm.c b/misc/comm.c index dfcce602b35..b9ad9bebf9d 100644 --- a/misc/comm.c +++ b/misc/comm.c @@ -270,7 +270,7 @@ static void comm_notification(int fd,void*private) /* write from output queue */ prev = comm_outbuf(ptr); do { - bleft = ((ptr->obuf_tail < ptr->obuf_head) ? ptr->obuf_head : ptr->obuf_size) + bleft = ((ptr->obuf_tail <= ptr->obuf_head) ? ptr->obuf_head : ptr->obuf_size) - ptr->obuf_tail; len = bleft ? write(fd, ptr->outbuf + ptr->obuf_tail, bleft) : 0; if (len > 0) {