Re: [PATCH] power: supply: bq256xx: replace deprecated strncpy with strscpy

2023-10-20 Thread Sebastian Reichel
On Fri, 20 Oct 2023 19:05:25 +, Justin Stitt wrote: > strncpy() is deprecated for use on NUL-terminated destination strings > [1] and as such we should prefer more robust and less ambiguous string > interfaces. > > We expect bq->model_name to be NUL-terminated based on its usage with > sysfs

Re: [PATCH] power: supply: bq256xx: replace deprecated strncpy with strscpy

2023-10-20 Thread Kees Cook
On Fri, Oct 20, 2023 at 07:05:25PM +, Justin Stitt wrote: > strncpy() is deprecated for use on NUL-terminated destination strings > [1] and as such we should prefer more robust and less ambiguous string > interfaces. > > We expect bq->model_name to be NUL-terminated based on its usage with > s

[PATCH] power: supply: bq256xx: replace deprecated strncpy with strscpy

2023-10-20 Thread Justin Stitt
strncpy() is deprecated for use on NUL-terminated destination strings [1] and as such we should prefer more robust and less ambiguous string interfaces. We expect bq->model_name to be NUL-terminated based on its usage with sysfs_emit and format strings: val->strval is assigned to bq->model_name i