Re: [PATCH] iio: accel: use strlcpy() instead of strncpy()

2018-01-14 Thread Jonathan Cameron
On Fri, 12 Jan 2018 15:45:38 +0800 Xiongfeng Wang wrote: > From: Xiongfeng Wang > > 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-trun

[PATCH] iio: accel: use strlcpy() instead of strncpy()

2018-01-11 Thread Xiongfeng Wang
From: Xiongfeng Wang 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 great