Commit 10229f37 authored by Yoichi Yuasa's avatar Yoichi Yuasa Committed by Ralf Baechle

MIPS: Alchemy: 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/928/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent ae7cbef5
...@@ -45,22 +45,13 @@ char **prom_envp; ...@@ -45,22 +45,13 @@ char **prom_envp;
void prom_init_cmdline(void) void prom_init_cmdline(void)
{ {
char *cp; int i;
int actr;
actr = 1; /* Always ignore argv[0] */
cp = &(arcs_cmdline[0]); for (i = 1; i < prom_argc; i++) {
while (actr < prom_argc) { strlcat(arcs_cmdline, prom_argv[i], COMMAND_LINE_SIZE);
strcpy(cp, prom_argv[actr]); if (i < (prom_argc - 1))
cp += strlen(prom_argv[actr]); strlcat(arcs_cmdline, " ", COMMAND_LINE_SIZE);
*cp++ = ' ';
actr++;
} }
if (cp != &(arcs_cmdline[0])) /* get rid of trailing space */
--cp;
if (prom_argc > 1)
*cp = '\0';
} }
char *prom_getenv(char *envname) char *prom_getenv(char *envname)
......
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