Re: [PATCH v3] EDAC/mc_sysfs: refactor deprecated strncpy

2023-09-14 Thread Kees Cook
On Wed, Sep 13, 2023 at 05:20:50PM +, Justin Stitt wrote: > `strncpy` is deprecated for use on NUL-terminated destination strings [1]. > > We should prefer more robust and less ambiguous string interfaces. > > A suitable replacement is `strscpy` [2] due to the fact that it > guarantees NUL-te

[PATCH v3] EDAC/mc_sysfs: refactor deprecated strncpy

2023-09-13 Thread Justin Stitt
`strncpy` is deprecated for use on NUL-terminated destination strings [1]. We should prefer more robust and less ambiguous string interfaces. A suitable replacement is `strscpy` [2] due to the fact that it guarantees NUL-termination on the destination buffer without needlessly NUL-padding. Link: