Restructure the code in ewmh_window_icon_from_reply() slightly

This is just a preparation for the following commit.

Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Uli Schlachter 2009-05-12 11:05:34 +02:00 committed by Julien Danjou
parent bd0a57d9f8
commit 3e64d05c3c
1 changed files with 7 additions and 4 deletions

11
ewmh.c
View File

@ -662,11 +662,14 @@ ewmh_window_icon_from_reply(xcb_get_property_reply_t *r)
{ {
uint32_t *data; uint32_t *data;
if(r && r->type == CARDINAL && r->format == 32 && r->length >= 2 && if(!r || r->type != CARDINAL || r->format != 32 || r->length < 2)
(data = (uint32_t *) xcb_get_property_value(r)) && data[0] && data[1]) return 0;
return image_new_from_argb32(data[0], data[1], data + 2);
return 0; data = (uint32_t *) xcb_get_property_value(r);
if (!data || !data[0] || !data[1])
return 0;
return image_new_from_argb32(data[0], data[1], data + 2);
} }
/** Get NET_WM_ICON. /** Get NET_WM_ICON.