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

Configure Feed

Select the types of activity you want to include in your feed.

checkpatch: prefer strscpy to strlcpy

Prefer strscpy over the deprecated strlcpy function.

Link: https://lkml.kernel.org/r/19fe91084890e2c16fe56f960de6c570a93fa99b.camel@perches.com
Signed-off-by: Joe Perches <joe@perches.com>
Requested-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Joe Perches and committed by
Linus Torvalds
5dbdb2d8 3a176b94

+6
+6
scripts/checkpatch.pl
··· 6646 6646 # } 6647 6647 # } 6648 6648 6649 + # strlcpy uses that should likely be strscpy 6650 + if ($line =~ /\bstrlcpy\s*\(/) { 6651 + WARN("STRLCPY", 6652 + "Prefer strscpy over strlcpy - see: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw\@mail.gmail.com/\n" . $herecurr); 6653 + } 6654 + 6649 6655 # typecasts on min/max could be min_t/max_t 6650 6656 if ($perl_version_ok && 6651 6657 defined $stat &&