summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--os/io.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/os/io.c b/os/io.c
index 015f1379e..5c3aceb2c 100644
--- a/os/io.c
+++ b/os/io.c
@@ -862,11 +862,14 @@ FlushClient(ClientPtr who, OsCommPtr oc, const void *__extraBuf, int extraCount)
long notWritten;
long todo;
- if (!oco || !oco->count)
+ if (!oco)
return 0;
written = 0;
padsize = padding_for_int32(extraCount);
notWritten = oco->count + extraCount + padsize;
+ if (!notWritten)
+ return 0;
+
todo = notWritten;
while (notWritten) {
long before = written; /* amount of whole thing written */