From c5d3adcccc5ed1221f7e0b011f8a823b6b22629b Mon Sep 17 00:00:00 2001 From: brooks Date: Wed, 25 Jul 2001 05:52:19 +0000 Subject: Fix a stupid bug which resulted in a blank line in the status output if WEP is supported, but not keys are set. MFC after: 3 days --- sbin/ifconfig/ifieee80211.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'sbin') diff --git a/sbin/ifconfig/ifieee80211.c b/sbin/ifconfig/ifieee80211.c index 0566dcd..ac8c871 100644 --- a/sbin/ifconfig/ifieee80211.c +++ b/sbin/ifconfig/ifieee80211.c @@ -359,10 +359,8 @@ ieee80211_status (s, info) printf("\n"); ireq.i_type = IEEE80211_IOC_WEP; - if (ioctl(s, SIOCG80211, &ireq) < 0 || - ireq.i_val == IEEE80211_WEP_NOSUP) - goto nowep; - else { + if (ioctl(s, SIOCG80211, &ireq) != -1 && + ireq.i_val != IEEE80211_WEP_NOSUP) { printf("\twepmode"); switch (ireq.i_val) { case IEEE80211_WEP_OFF: @@ -415,11 +413,9 @@ ieee80211_status (s, info) if(spacer == '\t') spacer = ' '; } - - printf("\n"); + if (spacer == ' ') + printf("\n"); } -nowep: - end: return; -- cgit v1.1