]> git.ipfire.org Git - thirdparty/iw.git/commitdiff
iw: fix regression in tx power validation
authorFelix Fietkau <nbd@openwrt.org>
Mon, 7 Nov 2011 17:49:51 +0000 (18:49 +0100)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 7 Nov 2011 17:58:36 +0000 (18:58 +0100)
Only bail out if the last character is *not* \0

phy.c

diff --git a/phy.c b/phy.c
index 91042b469fa72b04a01b5d9be06e77aa0cd94014..d9090fdffeb2a556fb99ef0e9472a697dea6dd7e 100644 (file)
--- a/phy.c
+++ b/phy.c
@@ -293,7 +293,7 @@ static int handle_txpower(struct nl80211_state *state,
                }
 
                mbm = strtol(argv[1], &endptr, 10);
-               if (!*endptr)
+               if (*endptr)
                        return 2;
                NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_TX_POWER_LEVEL, mbm);
        } else if (argc != 1)