Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

lib: move from strlcpy with unused retval to strscpy

Follow the advice of the below link and prefer 'strscpy' in this
subsystem. Conversion is 1:1 because the return value is not used.
Generated by a coccinelle script.

Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/
Link: https://lkml.kernel.org/r/20220818210203.8251-1-wsa+renesas@sang-engineering.com
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Wolfram Sang and committed by
Andrew Morton
977bbf43 a1d3a6d9

+1 -1
+1 -1
lib/earlycpio.c
··· 126 126 "File %s exceeding MAX_CPIO_FILE_NAME [%d]\n", 127 127 p, MAX_CPIO_FILE_NAME); 128 128 } 129 - strlcpy(cd.name, p + mypathsize, MAX_CPIO_FILE_NAME); 129 + strscpy(cd.name, p + mypathsize, MAX_CPIO_FILE_NAME); 130 130 131 131 cd.data = (void *)dptr; 132 132 cd.size = ch[C_FILESIZE];