From 2a43a49595969bda287745ac4103a72d801ab96b Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Wed, 27 Jul 2011 13:05:40 +0200 Subject: [PATCH] i3-config-wizard: correctly check for errors when connecting to X11 --- i3-config-wizard/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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);