aboutsummaryrefslogtreecommitdiff
path: root/coreutils/tail.c
diff options
context:
space:
mode:
Diffstat (limited to 'coreutils/tail.c')
-rw-r--r--coreutils/tail.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/coreutils/tail.c b/coreutils/tail.c
index 315eee188..321c5c4b2 100644
--- a/coreutils/tail.c
+++ b/coreutils/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;