Skip to content

Commit

Permalink
MIPS: Alchemy: 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/928/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
  • Loading branch information
Yoichi Yuasa authored and Ralf Baechle committed Feb 27, 2010
1 parent ae7cbef commit 10229f3
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions arch/mips/alchemy/common/prom.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,22 +45,13 @@ char **prom_envp;

void prom_init_cmdline(void)
{
char *cp;
int actr;

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

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

char *prom_getenv(char *envname)
Expand Down

0 comments on commit 10229f3

Please sign in to comment.