summaryrefslogtreecommitdiff
path: root/drivers/staging/rtl8188eu/os_dep
diff options
context:
space:
mode:
authorMichael Straube <straube.linux@gmail.com>2018-07-12 18:16:13 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-07-13 11:37:34 +0200
commitde9b58400a3ce6b9b6cc45f66c3f5e3d754becf1 (patch)
tree77146a9a360bba081d2be6f75fecf16eac05a088 /drivers/staging/rtl8188eu/os_dep
parenta796528951e25a9ee635bd22d0a6e2c4fb2bd45c (diff)
staging: rtl8188eu: use strlcpy instead of strncpy
Use strlcpy instead of strncpy to avoid gcc 8 warning: warning: '__builtin_strncpy' specified bound 16 equals destination size [-Wstringop-truncation] The maximum length of the source string including terminating null is 5. Hence it always fits in the destination buffer of length 16. Signed-off-by: Michael Straube <straube.linux@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8188eu/os_dep')
-rw-r--r--drivers/staging/rtl8188eu/os_dep/ioctl_linux.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c
index 80ccd19e776d..0f82a8c330f8 100644
--- a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c
+++ b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c
@@ -1912,7 +1912,7 @@ static int rtw_wx_set_enc_ext(struct net_device *dev,
goto exit;
}
- strncpy((char *)param->u.crypt.alg, alg_name, IEEE_CRYPT_ALG_NAME_LEN);
+ strlcpy((char *)param->u.crypt.alg, alg_name, IEEE_CRYPT_ALG_NAME_LEN);
if (pext->ext_flags & IW_ENCODE_EXT_SET_TX_KEY)
param->u.crypt.set_tx = 1;