- Avoid unnecessary strdup()

Submitted by:	ache
MFC after:	5 days
This commit is contained in:
Gabor Kovesdan 2013-01-20 11:58:49 +00:00
parent 9c17a1c7fe
commit cd64c5881d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=245688

View File

@ -481,7 +481,7 @@ main(int argc, char *argv[])
case 'e':
{
char *token;
char *string = strdup(optarg);
char *string = optarg;
while ((token = strsep(&string, "\n")) != NULL)
add_pattern(token, strlen(token));
@ -675,7 +675,7 @@ main(int argc, char *argv[])
/* Process patterns from command line */
if (aargc != 0 && needpattern) {
char *token;
char *string = strdup(*aargv);
char *string = *aargv;
while ((token = strsep(&string, "\n")) != NULL)
add_pattern(token, strlen(token));