summaryrefslogtreecommitdiff
path: root/tail.c
diff options
context:
space:
mode:
Diffstat (limited to 'tail.c')
-rw-r--r--tail.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/tail.c b/tail.c
index 315eee1..321c5c4 100644
--- a/tail.c
+++ b/tail.c
@@ -368,8 +368,10 @@ extern int tail_main(int argc, char **argv)
case 'h':
usage(tail_usage);
default:
- fprintf(stderr, "tail: invalid option -- %c\n", opt);
- usage(tail_usage);
+ if ((n_units = atoi(&argv[i][1])) < 1) {
+ fprintf(stderr, "tail: invalid option -- %c\n", opt);
+ usage(tail_usage);
+ }
}
} else {
break;