summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2003-05-10 13:39:05 +0000
committerJim Meyering <jim@meyering.net>2003-05-10 13:39:05 +0000
commit6c1a29f06f829f2835a35774b3d93a2d783a66ec (patch)
treef13a5a85fd6e27f5a7850b0696cde4778ea2506a
parent2de1d40446bc068b383f41dbc92c04a1fa1a62de (diff)
downloadcoreutils-6c1a29f06f829f2835a35774b3d93a2d783a66ec.tar.xz
(main): Don't segfault when argc < optind.
-rw-r--r--src/uniq.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/uniq.c b/src/uniq.c
index de556d7bd..dd3aa1da1 100644
--- a/src/uniq.c
+++ b/src/uniq.c
@@ -1,5 +1,5 @@
/* uniq -- remove duplicate lines from a sorted file
- Copyright (C) 86, 91, 1995-2002, Free Software Foundation, Inc.
+ Copyright (C) 86, 91, 1995-2003, Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -426,7 +426,7 @@ main (int argc, char **argv)
"-0123456789Dcdf:is:uw:", longopts, NULL))
== -1))
{
- if (optind == argc)
+ if (argc <= optind)
break;
if (nfiles == 2)
{