This commit is contained in:
Connor Lane Smith
2011-05-25 11:42:17 +01:00
parent a9c970b973
commit 262f357fdd
7 changed files with 77 additions and 8 deletions

View File

@@ -17,7 +17,7 @@ static time_t t;
int
main(int argc, char *argv[])
{
char c;
char *end, c;
t = time(NULL);
while((c = getopt(argc, argv, "ct:")) != -1)
@@ -26,7 +26,9 @@ main(int argc, char *argv[])
cflag = true;
break;
case 't':
t = strtol(optarg, NULL, 0);
t = strtol(optarg, &end, 0);
if(*end != '\0')
eprintf("%s: not a number\n", optarg);
break;
default:
exit(EXIT_FAILURE);