Use safe wrappers wherever possible

This commit is contained in:
shdown
2015-08-03 12:50:50 +03:00
parent bc52fae15c
commit c85d16faa4
14 changed files with 31 additions and 52 deletions

@ -208,13 +208,8 @@ void window_update_role(i3Window *win, xcb_get_property_reply_t *prop, bool befo
}
char *new_role;
if (asprintf(&new_role, "%.*s", xcb_get_property_value_length(prop),
(char *)xcb_get_property_value(prop)) == -1) {
perror("asprintf()");
DLOG("Could not get WM_WINDOW_ROLE\n");
free(prop);
return;
}
sasprintf(&new_role, "%.*s", xcb_get_property_value_length(prop),
(char *)xcb_get_property_value(prop));
FREE(win->role);
win->role = new_role;
LOG("WM_WINDOW_ROLE changed to \"%s\"\n", win->role);