]> git.ipfire.org Git - thirdparty/iw.git/commitdiff
iw: fix the beacon average signal parsing
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Thu, 4 Oct 2018 09:34:20 +0000 (12:34 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 9 Oct 2018 07:56:18 +0000 (09:56 +0200)
NL80211_STA_INFO_BEACON_SIGNAL_AVG is parsed as a u8, but
it should be casted to a int8_t before being printed.

Change-Id: Ieb6fab3b803d8ea82819a450f07cc4b537d8de8b
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
station.c

index fd38043b1b86bb167970fafa2a899e96c99d684a..dba56b73f3558e91a42bab9cac0a9fea27f2c8aa 100644 (file)
--- a/station.c
+++ b/station.c
@@ -388,7 +388,7 @@ static int print_sta_handler(struct nl_msg *msg, void *arg)
 
        if (sinfo[NL80211_STA_INFO_BEACON_SIGNAL_AVG])
                printf("\n\tbeacon signal avg:\t%d dBm",
-                      nla_get_u8(sinfo[NL80211_STA_INFO_BEACON_SIGNAL_AVG]));
+                      (int8_t)nla_get_u8(sinfo[NL80211_STA_INFO_BEACON_SIGNAL_AVG]));
        if (sinfo[NL80211_STA_INFO_T_OFFSET])
                printf("\n\tToffset:\t%llu us",
                       (unsigned long long)nla_get_u64(sinfo[NL80211_STA_INFO_T_OFFSET]));