From: Michael Stapelberg Date: Wed, 27 Jul 2011 11:05:40 +0000 (+0200) Subject: i3-config-wizard: correctly check for errors when connecting to X11 X-Git-Tag: 4.0~14^2~44 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=2a43a49595969bda287745ac4103a72d801ab96b;p=i3%2Fi3 i3-config-wizard: correctly check for errors when connecting to X11 --- diff --git a/i3-config-wizard/main.c b/i3-config-wizard/main.c index d66eda08..b59fb9f8 100644 --- a/i3-config-wizard/main.c +++ b/i3-config-wizard/main.c @@ -427,8 +427,8 @@ int main(int argc, char *argv[]) { socket_path = "/tmp/i3-ipc.sock"; int screens; - conn = xcb_connect(NULL, &screens); - if (xcb_connection_has_error(conn)) + if ((conn = xcb_connect(NULL, &screens)) == NULL || + xcb_connection_has_error(conn)) errx(1, "Cannot open display\n"); xcb_screen_t *root_screen = xcb_aux_get_screen(conn, screens);