Call usage() if given more than 1 argument.

Submitted by:	"Andrew R. Reiter" <arr@watson.org>
Obtained from:	OpenBSD
This commit is contained in:
Kris Kennaway 2001-04-24 10:39:17 +00:00
parent 6e76e16fe6
commit 345edac558

View File

@ -69,7 +69,7 @@ main(argc, argv)
{
register u_int secs;
register int hours, minutes;
register char c, *cp;
register char c, *cp = NULL;
struct tm *t, *localtime();
time_t now, time();
int plusnow, t_12_hour;
@ -84,7 +84,9 @@ main(argc, argv)
cp = fgets(buf, sizeof(buf), stdin);
if (cp == NULL || *cp == '\n')
exit(0);
} else
} else if (argc > 2)
usage();
else
cp = argv[1];
if (*cp == '+') {