Microoptimization of prev. patch: do strdup() only if (cflag || Cflag)

This commit is contained in:
ache 2003-08-03 22:19:43 +00:00
parent a6e8918154
commit a506e844d1

View File

@ -214,12 +214,14 @@ main(int argc, char **argv)
usage();
s1.str = argv[0];
if ((s2.str = strdup(argv[1])) == NULL)
errx(2, "strdup(argv[1])");
if (cflag || Cflag) {
if ((s2.str = strdup(argv[1])) == NULL)
errx(1, "strdup(argv[1])");
if (cflag || Cflag)
for (cnt = NCHARS, p = string1; cnt--;)
*p++ = OOBCH;
} else
s2.str = argv[1];
if (!next(&s2))
errx(1, "empty string2");