diff --git a/errno/errno.c b/errno/errno.c index ef09e34..8ee3b97 100644 --- a/errno/errno.c +++ b/errno/errno.c @@ -4,7 +4,7 @@ char *cmnd; -void usage(void) { +static void usage(void) { fprintf(stderr, "Usage: %s errno ...\n", cmnd); exit(1); } @@ -15,12 +15,20 @@ int main(int argc, char **argv) { cmnd = argv[0]; - if (argc <= 1) usage(); + if (argc <= 1) { + int e; + for (e = 0;; e++) { + printf("%d\t%s\n", e, strerror(e)); + } + } else { + for (i = 1; i < argc; i++) { + int e = strtoul(argv[i], NULL, 0); - for (i = 1; i < argc; i++) { - int e = strtoul(argv[i], NULL, 0); - - printf("%d\t%s\n", e, strerror(e)); + printf("%d\t%s\n", e, strerror(e)); + } } return 0; } +/* + * vim:sw=4 + */