Skip to content
Commit cb60610a authored by Xiongfeng Wang's avatar Xiongfeng Wang Committed by Jonathan Cameron
Browse files

iio: accel: use strlcpy() instead of strncpy()



gcc-8 reports

drivers/iio/accel/st_accel_i2c.c: In function 'st_accel_i2c_probe':
./include/linux/string.h:245:9: warning: '__builtin_strncpy' specified
bound 20 equals destination size [-Wstringop-truncation]

The compiler require that the length of the dest string is greater than
the length we want to copy to make sure the dest string is
nul-terminated. We can just use strlcpy() to avoid this warning.

Signed-off-by: default avatarXiongfeng Wang <xiongfeng.wang@linaro.org>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent a66a4e8e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment