From 566f3cb6f39a8ff39275d5a4518f2c595ac31416 Mon Sep 17 00:00:00 2001 From: Donnie Barnes Date: Thu, 22 Jul 1999 02:28:16 +0000 Subject: fixed bug oot introduced into my code --- src/usleep.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'src/usleep.c') diff --git a/src/usleep.c b/src/usleep.c index 76fe3106..f814bb7d 100644 --- a/src/usleep.c +++ b/src/usleep.c @@ -1,7 +1,7 @@ /* * usleep * - * Written by Donald Barnes for Red Hat Software. + * Written by Donald Barnes for Red Hat, Inc. * */ @@ -38,18 +38,21 @@ int main(int argc, char **argv) { } if (showVersion) { - printf("usleep version 1.1 by Donald Barnes \n usleep --help for more info\n"); + printf("usleep version 1.2\n usleep --help for more info\n"); return 0; } countStr = poptGetArg(optCon); - if (countStr && poptGetArg(optCon)) { - fprintf(stderr, "usleep: exactly one argument (number of microseconds) " - "must be used\n"); + + if (countStr == NULL) count = 1; + + else if (countStr && poptGetArg(optCon)) { + fprintf(stderr, "%s: exactly one argument (number of microseconds) " + "must be used\n", argv[0]); return 2; } - count = strtoul(countStr, NULL, 0); + else count = strtoul(countStr, NULL, 0); usleep(count); return 0; -- cgit v1.2.1