Skip to content

Commit 1bea9ab

Browse files
tobluxtsbogend
authored andcommitted
MIPS: Loongson2ef: Replace deprecated strncpy() with strscpy()
strncpy() is deprecated for NUL-terminated destination buffers. Use strscpy() instead and remove the manual NUL-termination. Compile-tested only. Link: KSPP#90 Cc: [email protected] Signed-off-by: Thorsten Blum <[email protected]> Signed-off-by: Thomas Bogendoerfer <[email protected]>
1 parent 232085d commit 1bea9ab

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

arch/mips/loongson2ef/common/machtype.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ void __init prom_init_machtype(void)
4848
return;
4949
}
5050
p += strlen("machtype=");
51-
strncpy(str, p, MACHTYPE_LEN);
52-
str[MACHTYPE_LEN] = '\0';
51+
strscpy(str, p);
5352
p = strstr(str, " ");
5453
if (p)
5554
*p = '\0';

0 commit comments

Comments
 (0)