Commit 9feb8367 authored by Yoichi Yuasa's avatar Yoichi Yuasa Committed by Ralf Baechle

MIPS: AR7: use strlcat() for the command line arguments

Signed-off-by: default avatarYoichi Yuasa <yuasa@linux-mips.org>
Cc: linux-mips <linux-mips@linux-mips.org>
Patchwork: http://patchwork.linux-mips.org/patch/871/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent e0e53dee
...@@ -56,22 +56,12 @@ char * __init prom_getcmdline(void) ...@@ -56,22 +56,12 @@ char * __init prom_getcmdline(void)
static void __init ar7_init_cmdline(int argc, char *argv[]) static void __init ar7_init_cmdline(int argc, char *argv[])
{ {
char *cp; int i;
int actr;
actr = 1; /* Always ignore argv[0] */
cp = &(arcs_cmdline[0]); for (i = 1; i < argc; i++) {
while (actr < argc) { strlcat(arcs_cmdline, argv[i], COMMAND_LINE_SIZE);
strcpy(cp, argv[actr]); if (i < (argc - 1))
cp += strlen(argv[actr]); strlcat(arcs_cmdline, " ", COMMAND_LINE_SIZE);
*cp++ = ' ';
actr++;
}
if (cp != &(arcs_cmdline[0])) {
/* get rid of trailing space */
--cp;
*cp = '\0';
} }
} }
...@@ -250,7 +240,7 @@ static void __init console_config(void) ...@@ -250,7 +240,7 @@ static void __init console_config(void)
else else
sprintf(console_string, " console=ttyS0,%d%c%c", baud, parity, sprintf(console_string, " console=ttyS0,%d%c%c", baud, parity,
bits); bits);
strcat(prom_getcmdline(), console_string); strlcat(arcs_cmdline, console_string, COMMAND_LINE_SIZE);
#endif #endif
} }
......
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