for determining when extra data needed to be read after a reply (to ensure
4-byte alignment) and the logic to determine whether or not to read reply
data after the SingleReply packet were both slightly wrong.
(void) _XReply(dpy, (xReply *) & reply, 0, False);
if (size != 0) {
- if ((reply.size >= 1) || reply_is_always_array) {
+ if ((reply.length > 0) || reply_is_always_array) {
const GLint bytes = (reply_is_always_array)
? (4 * reply.length) : (reply.size * size);
const GLint extra = 4 - (bytes & 3);
_XRead(dpy, dest, bytes);
- if ( extra != 0 ) {
+ if ( extra < 4 ) {
_XEatData(dpy, extra);
}
}
(void) _XReply(dpy, (xReply *) & reply, 0, False);
if (size != 0) {
- if ((reply.size >= 1) || reply_is_always_array) {
+ if ((reply.length > 0) || reply_is_always_array) {
const GLint bytes = (reply_is_always_array)
? (4 * reply.length) : (reply.size * size);
const GLint extra = 4 - (bytes & 3);
_XRead(dpy, dest, bytes);
- if ( extra != 0 ) {
+ if ( extra < 4 ) {
_XEatData(dpy, extra);
}
}