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 <xu.panda@zte.com.cn> Signed-off-by: Yang Yang <yang.yang29@zte.com> Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>
1 parent 76dcd73 commit af5d74e

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

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)