aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/rtl8192e/rtllib_softmac_wx.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/rtl8192e/rtllib_softmac_wx.c')
-rw-r--r--drivers/staging/rtl8192e/rtllib_softmac_wx.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/drivers/staging/rtl8192e/rtllib_softmac_wx.c b/drivers/staging/rtl8192e/rtllib_softmac_wx.c
index f89799d43b1b..57a6d1130b6a 100644
--- a/drivers/staging/rtl8192e/rtllib_softmac_wx.c
+++ b/drivers/staging/rtl8192e/rtllib_softmac_wx.c
@@ -539,18 +539,14 @@ int rtllib_wx_set_rawtx(struct rtllib_device *ieee,
}
EXPORT_SYMBOL(rtllib_wx_set_rawtx);
-int rtllib_wx_get_name(struct rtllib_device *ieee,
- struct iw_request_info *info,
- union iwreq_data *wrqu, char *extra)
+int rtllib_wx_get_name(struct rtllib_device *ieee, struct iw_request_info *info,
+ union iwreq_data *wrqu, char *extra)
{
- strcpy(wrqu->name, "802.11");
-
- if (ieee->modulation & RTLLIB_CCK_MODULATION)
- strcat(wrqu->name, "b");
- if (ieee->modulation & RTLLIB_OFDM_MODULATION)
- strcat(wrqu->name, "g");
- if (ieee->mode & (IEEE_N_24G | IEEE_N_5G))
- strcat(wrqu->name, "n");
+ const char *b = ieee->modulation & RTLLIB_CCK_MODULATION ? "b" : "";
+ const char *g = ieee->modulation & RTLLIB_OFDM_MODULATION ? "g" : "";
+ const char *n = ieee->mode & (IEEE_N_24G | IEEE_N_5G) ? "n" : "";
+
+ scnprintf(wrqu->name, sizeof(wrqu->name), "802.11%s%s%s", b, g, n);
return 0;
}
EXPORT_SYMBOL(rtllib_wx_get_name);