power: supply: bq2415x: replace deprecated strcpy() with strscpy()

strcpy() is deprecated for NUL-terminated strings. Replace it with
strscpy() for revstr (local fixed-size buffer).

Signed-off-by: Miguel García <miguelgarciaroman8@gmail.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
This commit is contained in:
Miguel García 2025-07-24 09:41:33 +02:00 committed by Sebastian Reichel
parent 980927603c
commit 5afce048a9

View File

@ -1516,7 +1516,7 @@ static int bq2415x_power_supply_init(struct bq2415x_device *bq)
ret = bq2415x_detect_revision(bq);
if (ret < 0)
strcpy(revstr, "unknown");
strscpy(revstr, "unknown", sizeof(revstr));
else
sprintf(revstr, "1.%d", ret);