]> git.sur5r.net Git - i3/i3status/commitdiff
wireless: call START_COLOR only once (Thanks XTaran)
authorMichael Stapelberg <michael@stapelberg.de>
Mon, 25 Feb 2013 23:32:24 +0000 (00:32 +0100)
committerMichael Stapelberg <michael@stapelberg.de>
Mon, 25 Feb 2013 23:32:24 +0000 (00:32 +0100)
src/print_wireless_info.c

index a678f522b92b7383666e3d2b1350af54cee42107..18f658073619ca408406968c6fc24d6d2dfe9022 100644 (file)
@@ -332,16 +332,15 @@ void print_wireless_info(yajl_gen json_gen, char *buffer, const char *interface,
                START_COLOR("color_bad");
                outwalk += sprintf(outwalk, "%s", format_down);
                goto out;
-       } else {
-               START_COLOR("color_good");
        }
 
         if (get_wireless_info(interface, &info)) {
                 walk = format_up;
                 if (info.flags & WIRELESS_INFO_FLAG_HAS_QUALITY)
                         START_COLOR((info.quality < info.quality_average ? "color_degraded" : "color_good"));
-        }
-        else {
+                else
+                        START_COLOR("color_good");
+        } else {
                 walk = format_down;
                 START_COLOR("color_bad");
         }