summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Stapelberg <michael@stapelberg.de>2013-02-26 00:32:24 +0100
committerMichael Stapelberg <michael@stapelberg.de>2013-02-26 00:32:24 +0100
commitb6c4d4ee4602fc34d0e9049bd61d0ac4babb78bf (patch)
treeae64057a1de272e99afde929f4f9ed6720f4a1dd /src
parent4a282a49787466099ceba018d9575ac21213e966 (diff)
wireless: call START_COLOR only once (Thanks XTaran)
Diffstat (limited to 'src')
-rw-r--r--src/print_wireless_info.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/print_wireless_info.c b/src/print_wireless_info.c
index a678f52..18f6580 100644
--- a/src/print_wireless_info.c
+++ b/src/print_wireless_info.c
@@ -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");
}