mirror of
https://github.com/torvalds/linux.git
synced 2026-05-27 16:44:58 +02:00
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:
parent
980927603c
commit
5afce048a9
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user