Commit 72ed7551 authored by Emanuele Giaquinta's avatar Emanuele Giaquinta Committed by Jeremy Huddleston

XQuartz: pbproxy: LP64: Fix itteration through XGetWindowProperty where sizeof(long) != 4

http://xquartz.macosforge.org/trac/ticket/476Signed-off-by: default avatarEmanuele Giaquinta <emanuele.giaquinta@gmail.com>
Reviewed-by: default avatarJeremy Huddleston <jeremyhu@apple.com>
parent 0a60192a
......@@ -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)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment