aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/alchemy
diff options
context:
space:
mode:
authorYoichi Yuasa <yuasa@linux-mips.org>2010-02-01 08:06:56 -0500
committerRalf Baechle <ralf@linux-mips.org>2010-02-27 06:53:21 -0500
commit10229f3761fdc1050f972bf3a4c4623bde20002f (patch)
treedccf71dff2eb8b2e382d7b7e376d4f14cb91cd39 /arch/mips/alchemy
parentae7cbef5e5789e2ee6855222a3b83eb94591ef0b (diff)
MIPS: Alchemy: 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/928/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/alchemy')
-rw-r--r--arch/mips/alchemy/common/prom.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/arch/mips/alchemy/common/prom.c b/arch/mips/alchemy/common/prom.c
index 79e099fbc0b..c29511b11d4 100644
--- a/arch/mips/alchemy/common/prom.c
+++ b/arch/mips/alchemy/common/prom.c
@@ -45,22 +45,13 @@ char **prom_envp;
45 45
46void prom_init_cmdline(void) 46void prom_init_cmdline(void)
47{ 47{
48 char *cp; 48 int i;
49 int actr;
50
51 actr = 1; /* Always ignore argv[0] */
52 49
53 cp = &(arcs_cmdline[0]); 50 for (i = 1; i < prom_argc; i++) {
54 while (actr < prom_argc) { 51 strlcat(arcs_cmdline, prom_argv[i], COMMAND_LINE_SIZE);
55 strcpy(cp, prom_argv[actr]); 52 if (i < (prom_argc - 1))
56 cp += strlen(prom_argv[actr]); 53 strlcat(arcs_cmdline, " ", COMMAND_LINE_SIZE);
57 *cp++ = ' ';
58 actr++;
59 } 54 }
60 if (cp != &(arcs_cmdline[0])) /* get rid of trailing space */
61 --cp;
62 if (prom_argc > 1)
63 *cp = '\0';
64} 55}
65 56
66char *prom_getenv(char *envname) 57char *prom_getenv(char *envname)