svn commit: r239894 - stable/9/games/pom

Maxim Konovalov maxim at FreeBSD.org
Thu Aug 30 07:45:26 UTC 2012


Author: maxim
Date: Thu Aug 30 07:45:25 2012
New Revision: 239894
URL: http://svn.freebsd.org/changeset/base/239894

Log:
  MFC r230644: preserve argv[0] to use it later in usage().

Modified:
  stable/9/games/pom/pom.c
Directory Properties:
  stable/9/games/pom/   (props changed)

Modified: stable/9/games/pom/pom.c
==============================================================================
--- stable/9/games/pom/pom.c	Thu Aug 30 07:38:24 2012	(r239893)
+++ stable/9/games/pom/pom.c	Thu Aug 30 07:45:25 2012	(r239894)
@@ -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);


More information about the svn-src-stable mailing list