]> git.sur5r.net Git - i3/i3/commitdiff
Only use font_info after we know, the request succeded
authorAxel Wagner <mail@merovius.de>
Sat, 1 Jan 2011 14:19:17 +0000 (15:19 +0100)
committerAxel Wagner <mail@merovius.de>
Sat, 1 Jan 2011 14:19:17 +0000 (15:19 +0100)
i3bar/src/xcb.c

index 326ca2ad8dd2cc60407bf4d882762f252813f0ce..5361f411fbdff24efef14ae12042423a64b0d762 100644 (file)
@@ -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 {