Message ID | 20250317143806244wrGxYdlssPbWp7T7W5Gbr@zte.com.cn |
---|---|
State | New |
Headers | show |
Series | ACPICA: Replace deprecated strncpy() with strscpy() | expand |
diff --git a/drivers/acpi/acpica/utnonansi.c b/drivers/acpi/acpica/utnonansi.c index ff0802ace19b..1da9b8246011 100644 --- a/drivers/acpi/acpica/utnonansi.c +++ b/drivers/acpi/acpica/utnonansi.c @@ -168,8 +168,7 @@ void acpi_ut_safe_strncpy(char *dest, char *source, acpi_size dest_size) { /* Always terminate destination string */ - strncpy(dest, source, dest_size); - dest[dest_size - 1] = 0; + strscpy(dest, source, dest_size); } #endif