]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(main): Don't segfault when argc < optind.
authorJim Meyering <jim@meyering.net>
Sat, 10 May 2003 13:39:05 +0000 (13:39 +0000)
committerJim Meyering <jim@meyering.net>
Sat, 10 May 2003 13:39:05 +0000 (13:39 +0000)
src/uniq.c

index de556d7bd8f72b4a76799aa14704d88e611d3787..dd3aa1da19ad8792b9f8dfe3b6580b33d3f0cb1f 100644 (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)
            {