1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-08-17 09:06:50 +02:00

(main): Don't segfault when argc < optind.

This commit is contained in:
Jim Meyering
2003-05-10 13:39:05 +00:00
parent 2de1d40446
commit 6c1a29f06f
+2 -2
View File
@@ -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)
{