i3-config-wizard: correctly check for errors when connecting to X11

This commit is contained in:
Michael Stapelberg 2011-07-27 13:05:40 +02:00
parent f84264ae41
commit 2a43a49595
1 changed files with 2 additions and 2 deletions

View File

@ -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);