eliminated some strcat()'s

This commit is contained in:
Todd C. Miller
1996-02-04 07:28:43 +00:00
parent 40555aba59
commit 5fd8419d8e

View File

@@ -286,13 +286,21 @@ void log_error(code)
if (code != VALIDATE_ERROR && !(code & GLOBAL_PROBLEM)) { if (code != VALIDATE_ERROR && !(code & GLOBAL_PROBLEM)) {
/* stuff the command into the logline */ /* stuff the command into the logline */
/* XXX - this could be sped up */ p = logline + strlen(logline);
strcat(logline, cmnd); strcpy(p, cmnd);
strcat(logline, " ");
/* add a trailing space */
p += strlen(cmnd);
*p++ = ' ';
*p = '\0';
/* cat on command args if they exist */
if (NewArgc > 1) if (NewArgc > 1)
for (a = &NewArgv[1]; *a; a++) { for (a = &NewArgv[1]; *a; a++) {
strcat(logline, *a); strcpy(p, *a);
strcat(logline, " "); p += strlen(*a);
*p++ = ' ';
*p = '\0';
} }
} }