[Xquartz-changes] xserver: Branch 'master'
Jeremy Huddleston
jeremyhu at freedesktop.org
Mon Apr 25 10:39:46 PDT 2011
hw/xquartz/pbproxy/x-selection.m | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
New commits:
commit 274e8a2b144c90d6ad529e1067686c2b3d8d223c
Author: Emanuele Giaquinta <emanuele.giaquinta at gmail.com>
Date: Mon Apr 25 10:38:17 2011 -0700
XQuartz: pbproxy: LP64: Fix itteration through XGetWindowProperty where sizeof(long) != 4
http://xquartz.macosforge.org/trac/ticket/476
Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
diff --git a/hw/xquartz/pbproxy/x-selection.m b/hw/xquartz/pbproxy/x-selection.m
index e3d5113..99cc543 100644
--- a/hw/xquartz/pbproxy/x-selection.m
+++ b/hw/xquartz/pbproxy/x-selection.m
@@ -175,7 +175,12 @@ get_property(Window win, Atom property, struct propdata *pdata, Bool delete, Ato
#endif
/* Format is the number of bits. */
- chunkbytesize = numitems * (format / 8);
+ if (format == 8)
+ chunkbytesize = numitems;
+ else if (format == 16)
+ chunkbytesize = numitems * sizeof(short);
+ else if (format == 32)
+ chunkbytesize = numitems * sizeof(long);
#ifdef TEST
printf("chunkbytesize %zu\n", chunkbytesize);
@@ -235,9 +240,9 @@ get_property(Window win, Atom property, struct propdata *pdata, Bool delete, Ato
return None;
}
- for (i = 0, step = pdata->format >> 3; i < pdata->length; i += step)
+ for (i = 0, step = sizeof(long); i < pdata->length; i += step)
{
- a = (Atom)*(uint32_t *)(pdata->data + i);
+ a = (Atom)*(long *)(pdata->data + i);
if (a == atoms->image_png)
{
More information about the Xquartz-changes
mailing list