summaryrefslogtreecommitdiff
path: root/src/XrrProvider.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/XrrProvider.c')
-rw-r--r--src/XrrProvider.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/XrrProvider.c b/src/XrrProvider.c
index d796cd0..1c7c43b 100644
--- a/src/XrrProvider.c
+++ b/src/XrrProvider.c
@@ -104,7 +104,6 @@ XRRFreeProviderResources(XRRProviderResources *provider_resources)
free(provider_resources);
}
-#define ProviderInfoExtra (SIZEOF(xRRGetProviderInfoReply) - 32)
XRRProviderInfo *
XRRGetProviderInfo(Display *dpy, XRRScreenResources *resources, RRProvider provider)
{
@@ -123,25 +122,22 @@ XRRGetProviderInfo(Display *dpy, XRRScreenResources *resources, RRProvider provi
req->provider = provider;
req->configTimestamp = resources->configTimestamp;
- if (!_XReply (dpy, (xReply *) &rep, ProviderInfoExtra >> 2, xFalse))
+ if (!_XReply (dpy, (xReply *) &rep, 0, xFalse))
{
UnlockDisplay (dpy);
SyncHandle ();
return NULL;
}
- if (rep.length > INT_MAX >> 2 || rep.length < ProviderInfoExtra >> 2)
+ if (rep.length > INT_MAX >> 2)
{
- if (rep.length < ProviderInfoExtra >> 2)
- _XEatDataWords (dpy, rep.length);
- else
- _XEatDataWords (dpy, rep.length - (ProviderInfoExtra >> 2));
+ _XEatDataWords (dpy, rep.length);
UnlockDisplay (dpy);
SyncHandle ();
return NULL;
}
- nbytes = ((long) rep.length << 2) - ProviderInfoExtra;
+ nbytes = ((long) rep.length << 2);
nbytesRead = (long)(rep.nCrtcs * 4 +
rep.nOutputs * 4 +
@@ -156,7 +152,7 @@ XRRGetProviderInfo(Display *dpy, XRRScreenResources *resources, RRProvider provi
xpi = (XRRProviderInfo *)Xmalloc(rbytes);
if (xpi == NULL) {
- _XEatDataWords (dpy, rep.length - (ProviderInfoExtra >> 2));
+ _XEatDataWords (dpy, rep.length);
UnlockDisplay (dpy);
SyncHandle ();
return NULL;