Skip to contentSkip to conversation

iw: fix output qualifier for unsigned values

PATCH Applied Arnd Hannemann 2 participants 2 messages Aug 17, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iw: fix output qualifier for unsigned values

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.

station.c +5 -5
diff -Naur iw-0.9.16.orig/station.c iw-0.9.16/station.c
@@ -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",
#1 lore raw
Quoted 2 lines · Arnd Hannemann

Seems to be the output qualifier %d is used wrongly in some cases. This patch fixes that.

Applied, thanks, but please CC me in the future as explained in the README file.

johannes