JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
Use intermediate pointer in getstate().
authorReginald Kennedy <rk@rejii.com>
Thu, 19 Jul 2012 23:40:29 +0000 (07:40 +0800)
committerReginald Kennedy <rk@rejii.com>
Fri, 20 Jul 2012 22:00:03 +0000 (06:00 +0800)
spectrwm.c

index e682774..c8daa81 100644 (file)
@@ -1988,6 +1988,7 @@ uint16_t
 getstate(xcb_window_t w)
 {
        uint16_t                        result = 0;
+       uint16_t                        *pv;
        xcb_get_property_cookie_t       c;
        xcb_get_property_reply_t        *r;
 
@@ -1995,7 +1996,8 @@ getstate(xcb_window_t w)
        r = xcb_get_property_reply(conn, c, NULL);
 
        if (r) {
-               result = *((uint16_t *)xcb_get_property_value(r));
+               pv = (uint16_t *)xcb_get_property_value(r);
+               result = *pv;
                free(r);
        }