Commit af5d74e3 authored by Xu Panda's avatar Xu Panda Committed by Greg Ungerer

m68k: use strscpy() to instead of strncpy()

The implementation of strscpy() is more robust and safer.
Signed-off-by: default avatarXu Panda <xu.panda@zte.com.cn>
Signed-off-by: default avatarYang Yang <yang.yang29@zte.com>
Signed-off-by: default avatarGreg Ungerer <gerg@linux-m68k.org>
parent 76dcd734
...@@ -90,8 +90,7 @@ void __init setup_arch(char **cmdline_p) ...@@ -90,8 +90,7 @@ void __init setup_arch(char **cmdline_p)
config_BSP(&command_line[0], sizeof(command_line)); config_BSP(&command_line[0], sizeof(command_line));
#if defined(CONFIG_BOOTPARAM) #if defined(CONFIG_BOOTPARAM)
strncpy(&command_line[0], CONFIG_BOOTPARAM_STRING, sizeof(command_line)); strscpy(&command_line[0], CONFIG_BOOTPARAM_STRING, sizeof(command_line));
command_line[sizeof(command_line) - 1] = 0;
#endif /* CONFIG_BOOTPARAM */ #endif /* CONFIG_BOOTPARAM */
process_uboot_commandline(&command_line[0], sizeof(command_line)); process_uboot_commandline(&command_line[0], sizeof(command_line));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment