From 909a5462acb6bee4025ce892a247b617c1cddbf2 Mon Sep 17 00:00:00 2001 From: stefan11111 Date: Thu, 7 Aug 2025 13:11:10 +0300 Subject: [PATCH] os: fix FlushClient Flushclient implicitly cast the result from a write-like call to size_t, which turned it's error return value, -1, into a large positive value, breaking the surrounding error-checking code. Signed-off-by: stefan11111 --- os/io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/os/io.c b/os/io.c index 476435c3df..7f22d71a74 100644 --- a/os/io.c +++ b/os/io.c @@ -916,7 +916,7 @@ FlushClient(ClientPtr who, OsCommPtr oc) size_t todo = notWritten; /* trying to write that much this time */ while (notWritten) { errno = 0; - size_t len = _XSERVTransWrite(trans_conn, (const char*)oco->buf + written, todo); + ssize_t len = _XSERVTransWrite(trans_conn, ((const char*)oco->buf) + written, todo); if (len >= 0) { written += len; notWritten -= len;