Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Miguel García and committed by
Sebastian Reichel
5afce048 98092760

+1 -1
+1 -1
drivers/power/supply/bq2415x_charger.c
··· 1516 1516 1517 1517 ret = bq2415x_detect_revision(bq); 1518 1518 if (ret < 0) 1519 - strcpy(revstr, "unknown"); 1519 + strscpy(revstr, "unknown", sizeof(revstr)); 1520 1520 else 1521 1521 sprintf(revstr, "1.%d", ret); 1522 1522