aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips
diff options
context:
space:
mode:
authorYoichi Yuasa <yuasa@linux-mips.org>2010-01-26 04:07:02 -0500
committerRalf Baechle <ralf@linux-mips.org>2010-02-27 06:53:14 -0500
commit9feb8367999265b8a300cb96e7a66f79b651c820 (patch)
treeb471a9590a69ef7bc0089cdbee39232e897434e0 /arch/mips
parente0e53dee69e07e9446eb16ceabd55a1116611696 (diff)
MIPS: AR7: use strlcat() for the command line arguments
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>
Diffstat (limited to 'arch/mips')
-rw-r--r--arch/mips/ar7/prom.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/arch/mips/ar7/prom.c b/arch/mips/ar7/prom.c
index f1cfd90a31d7..f5a6ed6deb3f 100644
--- a/arch/mips/ar7/prom.c
+++ b/arch/mips/ar7/prom.c
@@ -56,22 +56,12 @@ char * __init prom_getcmdline(void)
56 56
57static void __init ar7_init_cmdline(int argc, char *argv[]) 57static void __init ar7_init_cmdline(int argc, char *argv[])
58{ 58{
59 char *cp; 59 int i;
60 int actr;
61
62 actr = 1; /* Always ignore argv[0] */
63 60
64 cp = &(arcs_cmdline[0]); 61 for (i = 1; i < argc; i++) {
65 while (actr < argc) { 62 strlcat(arcs_cmdline, argv[i], COMMAND_LINE_SIZE);
66 strcpy(cp, argv[actr]); 63 if (i < (argc - 1))
67 cp += strlen(argv[actr]); 64 strlcat(arcs_cmdline, " ", COMMAND_LINE_SIZE);
68 *cp++ = ' ';
69 actr++;
70 }
71 if (cp != &(arcs_cmdline[0])) {
72 /* get rid of trailing space */
73 --cp;
74 *cp = '\0';
75 } 65 }
76} 66}
77 67
@@ -250,7 +240,7 @@ static void __init console_config(void)
250 else 240 else
251 sprintf(console_string, " console=ttyS0,%d%c%c", baud, parity, 241 sprintf(console_string, " console=ttyS0,%d%c%c", baud, parity,
252 bits); 242 bits);
253 strcat(prom_getcmdline(), console_string); 243 strlcat(arcs_cmdline, console_string, COMMAND_LINE_SIZE);
254#endif 244#endif
255} 245}
256 246