commit | a66b3a357bf41a9672c6f3dd96d3a5ad33c9a621 | [log] [tgz] |
---|---|---|
author | Johannes Berg <johannes.berg@intel.com> | Tue Nov 06 11:29:13 2012 +0100 |
committer | Johannes Berg <johannes.berg@intel.com> | Tue Nov 06 11:29:13 2012 +0100 |
tree | d198dd0fababc58b291afead695fc40d5cd8058a | |
parent | ced94d5f129e5d116b6a888f312deab081bb2231 [diff] [blame] |
fix bug in iftype_name() If the kernel has been updated, and iw hasn't but was recompiled, the function can return NULL which isn't desirable. Fix it.
diff --git a/util.c b/util.c index 869e0d6..2983e32 100644 --- a/util.c +++ b/util.c
@@ -139,7 +139,7 @@ const char *iftype_name(enum nl80211_iftype iftype) { - if (iftype <= NL80211_IFTYPE_MAX) + if (iftype <= NL80211_IFTYPE_MAX && ifmodes[iftype]) return ifmodes[iftype]; sprintf(modebuf, "Unknown mode (%d)", iftype); return modebuf;