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 2001-04-24 10:39:17 +00:00
parent e801e61e06
commit fb2fd90f05

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 == '+') {