o Preserve argv[0] to use it later in usage().
PR: bin/164570 Submitted by: Klaus Aehlig MFC after: 1 week
This commit is contained in:
parent
5d7380f8e3
commit
b5de771b40
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user