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

2023-10-20 Thread Sebastian Reichel
On Fri, 20 Oct 2023 18:14:47 +, 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 bdi->model_name to be NUL-terminated based on its usage with > sysf

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

2023-10-20 Thread Kees Cook
On Fri, Oct 20, 2023 at 06:14:47PM +, 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 bdi->model_name to be NUL-terminated based on its usage with >

[PATCH] power: supply: bq24190_charger: 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 bdi->model_name to be NUL-terminated based on its usage with sysfs_emit and format strings: val->strval is assigned to bdi->model_name