Search Linux Wireless

[PATCH] iw: fix output qualifier for unsigned values

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

with 0.9.16 a "iw wlan0 station dump" gives the following output:

Station XX:XX:XX:XX:XX:XX (on wlan0)
	inactive time:	4 ms
	rx bytes:	-1611945626
	rx packets:	7643414
	tx bytes:	1527923993
	tx packets:	4829428
	signal:  	-63 dBm
	tx bitrate:	54.0 MBit/s


Seems to be the output qualifier %d is used wrongly in some cases.
This patch fixes that.
Signed-off-by: Arnd Hannemann <hannemann@xxxxxxxxxxxxxxxxxxx>

diff -Naur iw-0.9.16.orig/station.c iw-0.9.16/station.c
--- iw-0.9.16.orig/station.c	2009-08-16 16:03:36.000000000 +0200
+++ iw-0.9.16/station.c	2009-08-17 12:31:58.119502558 +0200
@@ -80,19 +80,19 @@
 	printf("Station %s (on %s)", mac_addr, dev);
 
 	if (sinfo[NL80211_STA_INFO_INACTIVE_TIME])
-		printf("\n\tinactive time:\t%d ms",
+		printf("\n\tinactive time:\t%u ms",
 			nla_get_u32(sinfo[NL80211_STA_INFO_INACTIVE_TIME]));
 	if (sinfo[NL80211_STA_INFO_RX_BYTES])
-		printf("\n\trx bytes:\t%d",
+		printf("\n\trx bytes:\t%u",
 			nla_get_u32(sinfo[NL80211_STA_INFO_RX_BYTES]));
 	if (sinfo[NL80211_STA_INFO_RX_PACKETS])
-		printf("\n\trx packets:\t%d",
+		printf("\n\trx packets:\t%u",
 			nla_get_u32(sinfo[NL80211_STA_INFO_RX_PACKETS]));
 	if (sinfo[NL80211_STA_INFO_TX_BYTES])
-		printf("\n\ttx bytes:\t%d",
+		printf("\n\ttx bytes:\t%u",
 			nla_get_u32(sinfo[NL80211_STA_INFO_TX_BYTES]));
 	if (sinfo[NL80211_STA_INFO_TX_PACKETS])
-		printf("\n\ttx packets:\t%d",
+		printf("\n\ttx packets:\t%u",
 			nla_get_u32(sinfo[NL80211_STA_INFO_TX_PACKETS]));
 	if (sinfo[NL80211_STA_INFO_SIGNAL])
 		printf("\n\tsignal:  \t%d dBm",

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux