From: Jamey Sharp Date: Wed, 8 Mar 2006 05:19:58 +0000 (-0800) Subject: Fix off-by-one error that kept the last byte(s) of the output queue from being used. X-Git-Url: http://git.demorecorder.com/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c491eeb9a9f670f7d4869d7dae7a5adce4565998;p=free-sw%2Fxcb%2Flibxcb Fix off-by-one error that kept the last byte(s) of the output queue from being used. --- diff --git a/src/xcb_out.c b/src/xcb_out.c index 2494ef3..1faf2a5 100644 --- a/src/xcb_out.c +++ b/src/xcb_out.c @@ -237,7 +237,7 @@ int _xcb_out_write(XCBConnection *c) int _xcb_out_write_block(XCBConnection *c, struct iovec *vector, size_t count) { assert(!c->out.vec && !c->out.vec_len); - while(count && c->out.queue_len + vector[0].iov_len < sizeof(c->out.queue)) + while(count && c->out.queue_len + vector[0].iov_len <= sizeof(c->out.queue)) { memcpy(c->out.queue + c->out.queue_len, vector[0].iov_base, vector[0].iov_len); c->out.queue_len += vector[0].iov_len;