]> git.ipfire.org Git - thirdparty/iw.git/commitdiff
iw: correctly print signed TX power level
authorJohannes Berg <johannes.berg@intel.com>
Wed, 4 Mar 2020 14:54:22 +0000 (15:54 +0100)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 4 Mar 2020 14:54:22 +0000 (15:54 +0100)
This should be signed (per nl80211.h), but we put it
into a uint32_t, fix that.

Change-Id: I1ca8d3d74e2927c7fb38d5981b0628ea6da94298
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
interface.c

index b69748278803b4ca29dbe5b03feefa29af5ebeb4..6a44304628c2cf631ab3fa176fb41590a14b624b 100644 (file)
@@ -435,7 +435,7 @@ static int print_iface_handler(struct nl_msg *msg, void *arg)
        }
 
        if (tb_msg[NL80211_ATTR_WIPHY_TX_POWER_LEVEL]) {
-               uint32_t txp = nla_get_u32(tb_msg[NL80211_ATTR_WIPHY_TX_POWER_LEVEL]);
+               int32_t txp = nla_get_u32(tb_msg[NL80211_ATTR_WIPHY_TX_POWER_LEVEL]);
 
                printf("%s\ttxpower %d.%.2d dBm\n",
                       indent, txp / 100, txp % 100);