From 38c3547dfb51a9d62e2e3b498938f73b073f786d Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Thu, 27 Dec 2007 20:31:56 +0100 Subject: [PATCH] fix warning --- widgets/netwmicon.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/widgets/netwmicon.c b/widgets/netwmicon.c index 6da4720b3..576cc7088 100644 --- a/widgets/netwmicon.c +++ b/widgets/netwmicon.c @@ -34,6 +34,7 @@ netwmicon_draw(Widget *widget, DrawCtx *ctx, int offset, int used __attribute__ ((unused))) { unsigned long *data, pixel; + unsigned char *wdata; Atom type; int format, width, height, size, i; unsigned long items, rest; @@ -46,23 +47,25 @@ netwmicon_draw(Widget *widget, DrawCtx *ctx, int offset, if(XGetWindowProperty(ctx->display, sel->win, XInternAtom(ctx->display, "_NET_WM_ICON", False), 0L, LONG_MAX, False, XA_CARDINAL, &type, &format, - &items, &rest, (unsigned char**) &data) != Success - || !data) + &items, &rest, &wdata) != Success + || !wdata) return 0; if(type != XA_CARDINAL || format != 32 || items < 2) { - XFree(data); + XFree(wdata); return 0; } + data = (unsigned long *) wdata; + width = data[0]; height = data[1]; size = width * height; if(!size) { - XFree(data); + XFree(wdata); return 0; } @@ -85,7 +88,7 @@ netwmicon_draw(Widget *widget, DrawCtx *ctx, int offset, p_delete(&image); - XFree(data); + XFree(wdata); widget->width = widget->statusbar->height; return widget->width;