]> www.infradead.org Git - users/jedix/linux-maple.git/commit
hwmon: (pmbus/core) Replace deprecated strncpy() with strscpy()
authorThorsten Blum <thorsten.blum@linux.dev>
Thu, 27 Feb 2025 17:39:33 +0000 (18:39 +0100)
committerGuenter Roeck <linux@roeck-us.net>
Sun, 2 Mar 2025 16:30:11 +0000 (08:30 -0800)
commit69af654bf97232cf13a3924c27eac559b6fac951
tree86a91bb6e3f2de828280375500f02ee376d13042
parentfafac0ebb289288c767272d600644701e0df8a76
hwmon: (pmbus/core) Replace deprecated strncpy() with strscpy()

strncpy() is deprecated for NUL-terminated destination buffers; use
strscpy() instead.

Compile-tested only.

Note(groeck): strscpy() uses sizeof() to determine the length of the
destination buffer if it is not provided as argument.

Link: https://github.com/KSPP/linux/issues/90
Cc: linux-hardening@vger.kernel.org
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Link: https://lore.kernel.org/r/20250227173936.7746-2-thorsten.blum@linux.dev
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/pmbus/pmbus_core.c