From 08a5a2fdb056a5bb9675042b93b1111ea7ee6afe Mon Sep 17 00:00:00 2001 From: Axel Wagner Date: Sat, 1 Jan 2011 15:19:17 +0100 Subject: [PATCH] Only use font_info after we know, the request succeded --- i3bar/src/xcb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/i3bar/src/xcb.c b/i3bar/src/xcb.c index 326ca2ad..5361f411 100644 --- a/i3bar/src/xcb.c +++ b/i3bar/src/xcb.c @@ -552,12 +552,13 @@ void init_xcb(char *fontname) { font_info = xcb_query_font_reply(xcb_connection, query_font_cookie, NULL); - font_height = font_info->font_ascent + font_info->font_descent; if (xcb_request_failed(open_font_cookie, "Could not open font")) { exit(EXIT_FAILURE); } + font_height = font_info->font_ascent + font_info->font_descent; + if (xcb_query_font_char_infos_length(font_info) == 0) { font_table = NULL; } else { -- 2.39.5