[PATCH] nvme: Removing deprecated strncpy()
Caleb Sander Mateos
csander at purestorage.com
Tue Apr 15 07:39:22 PDT 2025
On Mon, Apr 14, 2025 at 5:37 PM Kevin Paul Reddy Janagari
<kevinpaul468 at gmail.com> wrote:
>
> This patch suggests the replacement of strncpy with strscpy
> as per Documentation/process/deprecated.
> The strncpy() fails to guarantee NULL termination,
> The function adds zero pads which isn't really convenient for short strings
> as it may cause performance issues.
>
> strscpy() is a preferred replacement because
> it overcomes the limitations of strncpy mentioned above.
This patch was posted to the mailing list earlier:
https://lists.infradead.org/pipermail/linux-nvme/2025-April/055004.html
Best,
Caleb
More information about the Linux-nvme
mailing list