From 27ade541a9cc93d25f0d705b2f1151111551e0ad Mon Sep 17 00:00:00 2001
From: Michael Stapelberg <michael@stapelberg.de>
Date: Wed, 24 Aug 2011 01:34:56 +0200
Subject: [PATCH] Initialize output (fixes compiler warning)

---
 i3bar/src/xcb.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/i3bar/src/xcb.c b/i3bar/src/xcb.c
index e25bc959..57d21f72 100644
--- a/i3bar/src/xcb.c
+++ b/i3bar/src/xcb.c
@@ -471,13 +471,17 @@ static void handle_client_message(xcb_client_message_event_t* event) {
             }
 
             DLOG("X window %08x requested docking\n", client);
-            i3_output *walk, *output;
+            i3_output *walk, *output = NULL;
             SLIST_FOREACH(walk, outputs, slist) {
                 if (!walk->active)
                     continue;
                 DLOG("using output %s\n", walk->name);
                 output = walk;
             }
+            if (output == NULL) {
+                ELOG("No output found\n");
+                return;
+            }
             xcb_reparent_window(xcb_connection,
                                 client,
                                 output->bar,