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

@@ -6,6 +6,7 @@
int
main(int argc, char *argv[])
{
char *end;
unsigned int seconds;
if(getopt(argc, argv, "") != -1)
@@ -13,7 +14,9 @@ main(int argc, char *argv[])
if(optind != argc-1)
eprintf("usage: %s seconds\n", argv[0]);
seconds = atoi(argv[optind]);
seconds = strtol(argv[optind], &end, 0);
if(*end != '\0')
eprintf("%s: not a number\n", argv[optind]);
while((seconds = sleep(seconds)) > 0)
;
return EXIT_SUCCESS;