Skip to content

Commit baa18b6

Browse files
tobluxij-intel
authored andcommitted
platform/x86: hp-bioscfg: Replace deprecated strncpy() with strscpy()
Since kstrtol() requires a NUL-terminated string as input and strncpy() is deprecated for NUL-terminated destination buffers, use strscpy() instead. Compile-tested only. Link: KSPP#90 Cc: [email protected] Signed-off-by: Thorsten Blum <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Ilpo Järvinen <[email protected]> Signed-off-by: Ilpo Järvinen <[email protected]>
1 parent 0b6d8f9 commit baa18b6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/platform/x86/hp/hp-bioscfg/bioscfg.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ int hp_convert_hexstr_to_str(const char *input, u32 input_len, char **str, int *
445445
return -ENOMEM;
446446

447447
for (i = 0; i < input_len; i += 5) {
448-
strncpy(tmp, input + i, strlen(tmp));
448+
strscpy(tmp, input + i);
449449
if (kstrtol(tmp, 16, &ch) == 0) {
450450
// escape char
451451
if (ch == '\\' ||

0 commit comments

Comments
 (0)