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

2023-10-21 Thread Maximilian Luz
On 10/20/23 21:39, 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 bat->name to be NUL-terminated based on its usage with strcmp(): power_supply_core.c: 445: re

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

2023-10-20 Thread Sebastian Reichel
On Fri, 20 Oct 2023 19:39:02 +, 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 bat->name to be NUL-terminated based on its usage with > strcmp():

[PATCH v2] power: supply: surface_battery: 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 bat->name to be NUL-terminated based on its usage with strcmp(): power_supply_core.c: 445: return strcmp(psy->desc->name, name) == 0;