Date: Sat, 28 Jan 2012 15:29:43 +0000 (UTC) From: Maxim Konovalov <maxim@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r230644 - head/games/pom Message-ID: <201201281529.q0SFThNk090801@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: maxim Date: Sat Jan 28 15:29:43 2012 New Revision: 230644 URL: http://svn.freebsd.org/changeset/base/230644 Log: o Preserve argv[0] to use it later in usage(). PR: bin/164570 Submitted by: Klaus Aehlig MFC after: 1 week Modified: head/games/pom/pom.c Modified: head/games/pom/pom.c ============================================================================== --- head/games/pom/pom.c Sat Jan 28 14:00:21 2012 (r230643) +++ head/games/pom/pom.c Sat Jan 28 15:29:43 2012 (r230644) @@ -86,6 +86,7 @@ main(int argc, char **argv) double days, today, tomorrow; int ch, cnt, pflag = 0; char *odate = NULL, *otime = NULL; + char *progname = argv[0]; while ((ch = getopt(argc, argv, "d:pt:")) != -1) switch (ch) { @@ -99,14 +100,14 @@ main(int argc, char **argv) otime = optarg; break; default: - usage(argv[0]); + usage(progname); } argc -= optind; argv += optind; if (argc) - usage(argv[0]); + usage(progname); /* Adjust based on users preferences */ time(&tt);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201201281529.q0SFThNk090801>