summaryrefslogtreecommitdiff
path: root/openbox/prop.c
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2003-04-14 17:06:32 +0000
committerDana Jansens <danakj@orodu.net>2003-04-14 17:06:32 +0000
commit3809fb37a5ccc1796cf0a2fdb5c87d3233adc687 (patch)
tree511dcd183bd740d80a76be267c5ee6c107d0e37d /openbox/prop.c
parent99fd65baf0b14356812ddc6881fd3fe2b996bd3b (diff)
do not commit bad char* foo that breaks on !32 bit platforms
Diffstat (limited to 'openbox/prop.c')
-rw-r--r--openbox/prop.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/openbox/prop.c b/openbox/prop.c
index 97f5fb94..52562f86 100644
--- a/openbox/prop.c
+++ b/openbox/prop.c
@@ -131,23 +131,21 @@ void prop_startup()
CREATE(openbox_premax, "_OPENBOX_PREMAX");
}
-gboolean prop_get(Window win, Atom prop, Atom type, int size,
- guchar **data, gulong num)
+gboolean prop_get32(Window win, Atom prop, Atom type, gulong **data,gulong num)
{
gboolean ret = FALSE;
int res;
- guchar *xdata = NULL;
+ gulong *xdata = NULL;
Atom ret_type;
int ret_size;
gulong ret_items, bytes_left;
- long num32 = 32 / size * num; /* num in 32-bit elements */
- res = XGetWindowProperty(ob_display, win, prop, 0l, num32,
+ res = XGetWindowProperty(ob_display, win, prop, 0l, num,
FALSE, type, &ret_type, &ret_size,
- &ret_items, &bytes_left, &xdata);
+ &ret_items, &bytes_left, (guchar**)&xdata);
if (res == Success && ret_items && xdata) {
- if (ret_size == size && ret_items >= num) {
- *data = g_memdup(xdata, num * (size / 8));
+ if (ret_size == 32 && ret_items >= num) {
+ *data = g_memdup(xdata, num * sizeof(gulong));
ret = TRUE;
}
XFree(xdata);