From: Masashi Honma <masashi.honma@gmail.com>
To: johannes@sipsolutions.net
Cc: linux-wireless@vger.kernel.org, Masashi Honma <masashi.honma@gmail.com>
Subject: [PATCH v2] iw: Fix bitrate output when no rate info found
Date: Tue, 14 Feb 2017 18:38:58 +0900 [thread overview]
Message-ID: <1487065138-4892-1-git-send-email-masashi.honma@gmail.com> (raw)
In-Reply-To: <1487049663-2942-1-git-send-email-masashi.honma@gmail.com>
Previously, bitrate showed uninitialized buffer when no rate info found.
This patch fixes the issue.
Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
---
station.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/station.c b/station.c
index f3e3da8..4885dc0 100644
--- a/station.c
+++ b/station.c
@@ -151,6 +151,8 @@ void parse_bitrate(struct nlattr *bitrate_attr, char *buf, int buflen)
if (rate > 0)
pos += snprintf(pos, buflen - (pos - buf),
"%d.%d MBit/s", rate / 10, rate % 10);
+ else
+ pos += snprintf(pos, buflen - (pos - buf), "(unknown)");
if (rinfo[NL80211_RATE_INFO_MCS])
pos += snprintf(pos, buflen - (pos - buf),
--
2.7.4
next prev parent reply other threads:[~2017-02-14 9:39 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-14 5:21 [PATCH] iw: Fix bitrate output when no rate info found Masashi Honma
2017-02-14 5:26 ` Masashi Honma
2017-02-14 8:35 ` Johannes Berg
2017-02-14 8:55 ` Masashi Honma
2017-02-14 9:14 ` Johannes Berg
2017-02-14 9:35 ` Masashi Honma
2017-02-14 9:38 ` Masashi Honma [this message]
2017-02-14 9:45 ` [PATCH v2] " 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=1487065138-4892-1-git-send-email-masashi.honma@gmail.com \
--to=masashi.honma@gmail.com \
--cc=johannes@sipsolutions.net \
--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