Skip to content

Commit

Permalink
MIPS: AR7: use strlcat() for the command line arguments
Browse files Browse the repository at this point in the history
Signed-off-by: Yoichi Yuasa <yuasa@linux-mips.org>
Cc: linux-mips <linux-mips@linux-mips.org>
Patchwork: http://patchwork.linux-mips.org/patch/871/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
  • Loading branch information
Yoichi Yuasa authored and Ralf Baechle committed Feb 27, 2010
1 parent e0e53de commit 9feb836
Showing 1 changed file with 6 additions and 16 deletions.
22 changes: 6 additions & 16 deletions arch/mips/ar7/prom.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,22 +56,12 @@ char * __init prom_getcmdline(void)

static void __init ar7_init_cmdline(int argc, char *argv[])
{
char *cp;
int actr;

actr = 1; /* Always ignore argv[0] */
int i;

cp = &(arcs_cmdline[0]);
while (actr < argc) {
strcpy(cp, argv[actr]);
cp += strlen(argv[actr]);
*cp++ = ' ';
actr++;
}
if (cp != &(arcs_cmdline[0])) {
/* get rid of trailing space */
--cp;
*cp = '\0';
for (i = 1; i < argc; i++) {
strlcat(arcs_cmdline, argv[i], COMMAND_LINE_SIZE);
if (i < (argc - 1))
strlcat(arcs_cmdline, " ", COMMAND_LINE_SIZE);
}
}

Expand Down Expand Up @@ -250,7 +240,7 @@ static void __init console_config(void)
else
sprintf(console_string, " console=ttyS0,%d%c%c", baud, parity,
bits);
strcat(prom_getcmdline(), console_string);
strlcat(arcs_cmdline, console_string, COMMAND_LINE_SIZE);
#endif
}

Expand Down

0 comments on commit 9feb836

Please sign in to comment.