Search Linux Wireless

[PATCH 1/2] iw: fix country print

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

 



Using a %s to pring the alpha2 may give us some extra
data which will spew out when printing. Fix it by only
printing the two characters we know we will get.

Signed-off-by: Luis R. Rodriguez <lrodriguez@xxxxxxxxxxx>
---
 reg.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/reg.c b/reg.c
index 7f82e08..c4ee1c4 100644
--- a/reg.c
+++ b/reg.c
@@ -132,7 +132,7 @@ static int print_reg_handler(struct nl_msg *msg, void *arg)
 	}
 
 	alpha2 = nla_data(tb_msg[NL80211_ATTR_REG_ALPHA2]);
-	printf("country %s:\n", alpha2);
+	printf("country %c%c:\n", alpha2[0], alpha2[1]);
 
 	nla_for_each_nested(nl_rule, tb_msg[NL80211_ATTR_REG_RULES], rem_rule) {
 		struct nlattr *tb_rule[NL80211_FREQUENCY_ATTR_MAX + 1];
-- 
1.7.3.2.90.gd4c43

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[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