diff options
author | bapt <bapt@FreeBSD.org> | 2015-05-05 08:25:25 +0000 |
---|---|---|
committer | bapt <bapt@FreeBSD.org> | 2015-05-05 08:25:25 +0000 |
commit | 41ce6200533a256705670404566b32f9ef58ac9c (patch) | |
tree | f2daa171d5adc4072027ce7a876ed049a9f6b235 /usr.bin/vgrind | |
parent | de72406be4883793a0a9c70fe1f3d0e99a7da182 (diff) | |
download | FreeBSD-src-41ce6200533a256705670404566b32f9ef58ac9c.zip FreeBSD-src-41ce6200533a256705670404566b32f9ef58ac9c.tar.gz |
Prevent useless use of strdup(3)
Obtained from: NetBSD
Diffstat (limited to 'usr.bin/vgrind')
-rw-r--r-- | usr.bin/vgrind/vfontedpr.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/vgrind/vfontedpr.c b/usr.bin/vgrind/vfontedpr.c index cb50261..5002e65 100644 --- a/usr.bin/vgrind/vfontedpr.c +++ b/usr.bin/vgrind/vfontedpr.c @@ -124,6 +124,8 @@ bool l_toplex; /* procedures only defined at top lex level */ const char *language = "c"; /* the language indicator */ #define ps(x) printf("%s", x) +static char minus[] = "-"; +static char minusn[] = "-n"; int main(int argc, char **argv) @@ -158,7 +160,7 @@ main(int argc, char **argv) if (!strcmp(argv[0], "-f")) { filter = true; argv[0] = argv[argc-1]; - argv[argc-1] = strdup("-"); + argv[argc-1] = minus; continue; } @@ -171,7 +173,7 @@ main(int argc, char **argv) /* build an index */ if (!strcmp(argv[0], "-x")) { idx = true; - argv[0] = strdup("-n"); + argv[0] = minusn; } /* indicate no keywords */ |