summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/realtek/rtl818x
diff options
context:
space:
mode:
authorLarry Finger <Larry.Finger@lwfinger.net>2018-08-20 20:48:31 +0200
committerKalle Valo <kvalo@codeaurora.org>2018-08-31 17:46:19 +0200
commit199ba9faca909e77ac533449ecd1248123ce89e7 (patch)
treed31dc7a0c50816faa0b61899cee69d989249efb2 /drivers/net/wireless/realtek/rtl818x
parentorinoco: remove unused array encaps_hdr and macro ENCAPS_OVERHEAD (diff)
downloadlinux-199ba9faca909e77ac533449ecd1248123ce89e7.tar.xz
linux-199ba9faca909e77ac533449ecd1248123ce89e7.zip
rtl8187: Fix warning generated when strncpy() destination length matches the sixe argument
In gcc8, when the 3rd argument (size) of a call to strncpy() matches the length of the first argument, the compiler warns of the possibility of an unterminated string. Using strlcpy() forces a null at the end. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/realtek/rtl818x')
-rw-r--r--drivers/net/wireless/realtek/rtl818x/rtl8187/leds.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/wireless/realtek/rtl818x/rtl8187/leds.c b/drivers/net/wireless/realtek/rtl818x/rtl8187/leds.c
index c2d5b495c179..c089540116fa 100644
--- a/drivers/net/wireless/realtek/rtl818x/rtl8187/leds.c
+++ b/drivers/net/wireless/realtek/rtl818x/rtl8187/leds.c
@@ -146,7 +146,7 @@ static int rtl8187_register_led(struct ieee80211_hw *dev,
led->dev = dev;
led->ledpin = ledpin;
led->is_radio = is_radio;
- strncpy(led->name, name, sizeof(led->name));
+ strlcpy(led->name, name, sizeof(led->name));
led->led_dev.name = led->name;
led->led_dev.default_trigger = default_trigger;