From d137057fd13e83ec15ab416c7fe774741da06047 Mon Sep 17 00:00:00 2001 From: marha Date: Tue, 10 Jul 2012 14:56:29 +0200 Subject: fontconfig mesa xserver git update 10 Jul 2012 --- xorg-server/os/io.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'xorg-server/os/io.c') diff --git a/xorg-server/os/io.c b/xorg-server/os/io.c index b67a5f324..e44db3933 100644 --- a/xorg-server/os/io.c +++ b/xorg-server/os/io.c @@ -578,8 +578,6 @@ ResetCurrentRequest(ClientPtr client) } } -static const int padlength[4] = { 0, 3, 2, 1 }; - /******************** * FlushAllOutput() * Flush all clients with output. However, if some client still @@ -757,7 +755,7 @@ WriteToClient(ClientPtr who, int count, const void *__buf) oc->output = oco; } - padBytes = padlength[count & 3]; + padBytes = padding_for_int32(count); if (ReplyCallback) { ReplyInfoRec replyinfo; @@ -815,7 +813,11 @@ WriteToClient(ClientPtr who, int count, const void *__buf) NewOutputPending = TRUE; FD_SET(oc->fd, &OutputPending); memmove((char *) oco->buf + oco->count, buf, count); - oco->count += count + padBytes; + oco->count += count; + if (padBytes) { + memset(oco->buf + oco->count, '\0', padBytes); + oco->count += padBytes; + } return count; } @@ -846,7 +848,7 @@ FlushClient(ClientPtr who, OsCommPtr oc, const void *__extraBuf, int extraCount) if (!oco) return 0; written = 0; - padsize = padlength[extraCount & 3]; + padsize = padding_for_int32(extraCount); notWritten = oco->count + extraCount + padsize; todo = notWritten; while (notWritten) { -- cgit v1.2.3