]> git.ipfire.org Git - thirdparty/iw.git/blobdiff - util.c
fix bug in iftype_name()
[thirdparty/iw.git] / util.c
diff --git a/util.c b/util.c
index 869e0d67e2c95df42a2a4613ea805ba01b801131..2983e32eb97268de1fa3858e80a25ba9a992de49 100644 (file)
--- a/util.c
+++ b/util.c
@@ -139,7 +139,7 @@ static char modebuf[100];
 
 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;