summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2001-08-25 15:09:31 +0000
committerJim Meyering <jim@meyering.net>2001-08-25 15:09:31 +0000
commit598382f21600159f5896155877a2f2e04effb0bf (patch)
treeaf08eb1fc23e91844d7122e5fc69218229aea292 /src
parentba2900b4aabaf468ba28a06812d2ea9c46743b25 (diff)
downloadcoreutils-598382f21600159f5896155877a2f2e04effb0bf.tar.xz
(main): Fix a typo in the previous patch: missing
a bounds check for examples like `uniq a b c'.
Diffstat (limited to 'src')
-rw-r--r--src/uniq.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/uniq.c b/src/uniq.c
index 36119cff8..fc2b19a82 100644
--- a/src/uniq.c
+++ b/src/uniq.c
@@ -413,6 +413,11 @@ main (int argc, char **argv)
{
if (optind == argc)
break;
+ if (nfiles == 2)
+ {
+ error (0, 0, _("extra operand `%s'"), argv[optind]);
+ usage (1);
+ }
file[nfiles++] = argv[optind++];
}
else switch (optc)