diff options
author | Keith Packard <keithp@neko.keithp.com> | 2007-01-31 14:24:57 -0800 |
---|---|---|
committer | Keith Packard <keithp@neko.keithp.com> | 2007-01-31 14:24:57 -0800 |
commit | 9c4fea702a0382689898fc14cbdab456fb18c403 (patch) | |
tree | 61a362f954beec4191bc32c209b6ffcc23fe4a71 /src/XrrProperty.c | |
parent | c85237a1651ae8e1abe9ae442ffa04dcb20c1d3e (diff) | |
parent | 382b7a3cfabdd37a6231e18a2ac92bc8a3722b79 (diff) |
Merge 64-bit fixes in
Diffstat (limited to 'src/XrrProperty.c')
-rw-r--r-- | src/XrrProperty.c | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/src/XrrProperty.c b/src/XrrProperty.c index 07226d8..8377fff 100644 --- a/src/XrrProperty.c +++ b/src/XrrProperty.c @@ -106,24 +106,26 @@ XRRQueryOutputProperty (Display *dpy, RROutput output, Atom property) return NULL; } - if (rep.length) { - rbytes = sizeof (XRRPropertyInfo) + rep.length * sizeof (long); - nbytes = rep.length << 2; + rbytes = sizeof (XRRPropertyInfo) + rep.length * sizeof (long); + nbytes = rep.length << 2; - prop_info = (XRRPropertyInfo *) Xmalloc (rbytes); - if (prop_info == NULL) { - _XEatData (dpy, nbytes); - UnlockDisplay (dpy); - SyncHandle (); - return NULL; - } - prop_info->pending = rep.pending; - prop_info->range = rep.range; - prop_info->immutable = rep.immutable; - prop_info->num_values = rep.length; - prop_info->values = (long *) (prop_info + 1); + prop_info = (XRRPropertyInfo *) Xmalloc (rbytes); + if (prop_info == NULL) { + _XEatData (dpy, nbytes); + UnlockDisplay (dpy); + SyncHandle (); + return NULL; + } + prop_info->pending = rep.pending; + prop_info->range = rep.range; + prop_info->immutable = rep.immutable; + prop_info->num_values = rep.length; + if (rep.length != 0) { + prop_info->values = (long *) (prop_info + 1); _XRead32 (dpy, prop_info->values, nbytes); + } else { + prop_info->values = NULL; } UnlockDisplay (dpy); |