Date: Tue, 5 May 2015 08:25:26 +0000 (UTC) From: Baptiste Daroussin <bapt@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282460 - head/usr.bin/vgrind Message-ID: <201505050825.t458PQ93034067@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: bapt Date: Tue May 5 08:25:25 2015 New Revision: 282460 URL: https://svnweb.freebsd.org/changeset/base/282460 Log: Prevent useless use of strdup(3) Obtained from: NetBSD Modified: head/usr.bin/vgrind/vfontedpr.c Modified: head/usr.bin/vgrind/vfontedpr.c ============================================================================== --- head/usr.bin/vgrind/vfontedpr.c Tue May 5 08:17:40 2015 (r282459) +++ head/usr.bin/vgrind/vfontedpr.c Tue May 5 08:25:25 2015 (r282460) @@ -124,6 +124,8 @@ bool l_toplex; /* procedures only defi 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 */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201505050825.t458PQ93034067>