]> git.ipfire.org Git - thirdparty/iw.git/commitdiff
iw: fix off-by-one
authorJohannes Berg <johannes.berg@intel.com>
Fri, 18 Sep 2015 08:54:17 +0000 (10:54 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 18 Sep 2015 08:54:17 +0000 (10:54 +0200)
An off-by-one prevented printing the very last command, fix it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
info.c

diff --git a/info.c b/info.c
index 4ce997e3c67047e85b1df6817a828c4b726cfc75..c23e37839519061030ee1443bed3d8bbc8658621 100644 (file)
--- a/info.c
+++ b/info.c
@@ -672,7 +672,7 @@ static int handle_commands(struct nl80211_state *state, struct nl_msg *msg,
                           int argc, char **argv, enum id_input id)
 {
        int i;
-       for (i = 1; i < NL80211_CMD_MAX; i++)
+       for (i = 1; i <= NL80211_CMD_MAX; i++)
                printf("%d (0x%x): %s\n", i, i, command_name(i));
        /* don't send netlink messages */
        return 2;