Prefer strscpy over the deprecated strlcpy function.
Showing the changes to scripts/checkpatch.pl (1 of 1 file). Show all
Unified · Split
| @@ -6646,6 +6646,12 @@ sub process { · 6645 unmodified lines | |||
| 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 | # typecasts on min/max could be min_t/max_t | 6655 | # typecasts on min/max could be min_t/max_t |
| 6650 | if ($perl_version_ok && | 6656 | if ($perl_version_ok && |
| 6651 | defined $stat && | 6657 | defined $stat && |