From 01210258d09cda5df3c289e08ec9fbe314be2b90 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Mon, 19 Apr 2010 13:29:52 +0200 Subject: [PATCH] Treat the interface as 'down' when it cannot be found in /proc/net/wireless (Thanks to Fabio Zanini) --- src/print_wireless_info.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/print_wireless_info.c b/src/print_wireless_info.c index 946c589..968ff66 100644 --- a/src/print_wireless_info.c +++ b/src/print_wireless_info.c @@ -38,7 +38,7 @@ static const char *get_wireless_essid(const char *interface) { */ void print_wireless_info(const char *interface, const char *format_up, const char *format_down) { char buf[1024]; - int quality = -1; + int quality = 0; char *interfaces; const char *walk; memset(buf, 0, sizeof(buf)); @@ -57,10 +57,6 @@ void print_wireless_info(const char *interface, const char *format_up, const cha break; } - /* Interface could not be found */ - if (quality == -1) - return; - if ((quality == UCHAR_MAX) || (quality == 0)) { walk = format_down; printf("%s", color("#FF0000")); -- 2.39.5