Skip to content

Commit af5d74e

Browse files
Xu PandaGreg Ungerer
authored andcommitted
m68k: use strscpy() to instead of strncpy()
The implementation of strscpy() is more robust and safer. Signed-off-by: Xu Panda <[email protected]> Signed-off-by: Yang Yang <[email protected]> Signed-off-by: Greg Ungerer <[email protected]>
1 parent 76dcd73 commit af5d74e

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

arch/m68k/kernel/setup_no.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,7 @@ void __init setup_arch(char **cmdline_p)
9090
config_BSP(&command_line[0], sizeof(command_line));
9191

9292
#if defined(CONFIG_BOOTPARAM)
93-
strncpy(&command_line[0], CONFIG_BOOTPARAM_STRING, sizeof(command_line));
94-
command_line[sizeof(command_line) - 1] = 0;
93+
strscpy(&command_line[0], CONFIG_BOOTPARAM_STRING, sizeof(command_line));
9594
#endif /* CONFIG_BOOTPARAM */
9695

9796
process_uboot_commandline(&command_line[0], sizeof(command_line));

0 commit comments

Comments
 (0)