summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEgbert Eich <eich@freedesktop.org>2004-03-04 18:01:00 +0000
committerEgbert Eich <eich@freedesktop.org>2004-03-04 18:01:00 +0000
commit6e8dc17dba9e108191a9aa7b5de7313fbad17424 (patch)
treeeff51f6241f80155e599129eebf8d1f6d9d0b1a1
parent9e4e9b2d737bea7ff81f4fe69dff02274175a5d9 (diff)
downloadxorg-lib-libX11-6e8dc17dba9e108191a9aa7b5de7313fbad17424.tar.gz
19. Merging in Kaleb's changes to XlibInt.c which reflect Keith's fix to version 3.41 in the Xlib repository (Egbert Eich).
-rw-r--r--src/XlibInt.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/XlibInt.c b/src/XlibInt.c
index cc73b7df..172fc9e5 100644
--- a/src/XlibInt.c
+++ b/src/XlibInt.c
@@ -1281,9 +1281,10 @@ void _XReadPad(
if (bytes_read > 0) {
size -= bytes_read;
if (iov[0].iov_len < bytes_read) {
- iov[1].iov_len += iov[0].iov_len - bytes_read;
+ int pad_bytes_read = bytes_read - iov[0].iov_len;
+ iov[1].iov_len -= pad_bytes_read;
iov[1].iov_base =
- (char *)iov[1].iov_base + bytes_read - iov[0].iov_len;
+ (char *)iov[1].iov_base + pad_bytes_read;
iov[0].iov_len = 0;
}
else {