demos: Fix useless NULL check in cube and tri
authorLenny Komow <lenny@lunarg.com>
Thu, 11 Aug 2016 16:57:38 +0000 (10:57 -0600)
committerLenny Komow <lenny@lunarg.com>
Thu, 11 Aug 2016 16:57:38 +0000 (10:57 -0600)
demos/cube.c
demos/tri.c

index c6d7d79..17617e5 100644 (file)
@@ -2947,7 +2947,7 @@ static void demo_init_connection(struct demo *demo) {
     int scr;
 
     demo->connection = xcb_connect(NULL, &scr);
-    if (demo->connection == NULL) {
+    if (xcb_connection_has_error(demo->connection) > 0) {
         printf("Cannot find a compatible Vulkan installable client driver "
                "(ICD).\nExiting ...\n");
         fflush(stdout);
index 35d33f2..9baa23a 100644 (file)
@@ -2418,7 +2418,7 @@ static void demo_init_connection(struct demo *demo) {
     int scr;
 
     demo->connection = xcb_connect(NULL, &scr);
-    if (demo->connection == NULL) {
+    if (xcb_connection_has_error(demo->connection) > 0) {
         printf("Cannot find a compatible Vulkan installable client driver "
                "(ICD).\nExiting ...\n");
         fflush(stdout);