public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnd Hannemann <hannemann@nets.rwth-aachen.de>
To: "linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Subject: [PATCH] iw: fix output qualifier for unsigned values
Date: Mon, 17 Aug 2009 12:46:56 +0200	[thread overview]
Message-ID: <4A893520.1010901@nets.rwth-aachen.de> (raw)

[-- Attachment #1: Type: text/plain, Size: 353 bytes --]

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.

[-- Attachment #2: iw_use_unsigned.patch --]
[-- Type: text/x-patch, Size: 1198 bytes --]

Signed-off-by: Arnd Hannemann <hannemann@nets.rwth-aachen.de>

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",

             reply	other threads:[~2009-08-17 10:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-17 10:46 Arnd Hannemann [this message]
2009-08-17 10:58 ` [PATCH] iw: fix output qualifier for unsigned values Johannes Berg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A893520.1010901@nets.rwth-aachen.de \
    --to=hannemann@nets.rwth-aachen.de \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox