Only use font_info after we know, the request succeded
This commit is contained in:
parent
600c4ae95c
commit
08a5a2fdb0
|
@ -552,12 +552,13 @@ void init_xcb(char *fontname) {
|
||||||
font_info = xcb_query_font_reply(xcb_connection,
|
font_info = xcb_query_font_reply(xcb_connection,
|
||||||
query_font_cookie,
|
query_font_cookie,
|
||||||
NULL);
|
NULL);
|
||||||
font_height = font_info->font_ascent + font_info->font_descent;
|
|
||||||
|
|
||||||
if (xcb_request_failed(open_font_cookie, "Could not open font")) {
|
if (xcb_request_failed(open_font_cookie, "Could not open font")) {
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
font_height = font_info->font_ascent + font_info->font_descent;
|
||||||
|
|
||||||
if (xcb_query_font_char_infos_length(font_info) == 0) {
|
if (xcb_query_font_char_infos_length(font_info) == 0) {
|
||||||
font_table = NULL;
|
font_table = NULL;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue