1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-07-25 18:19:00 +02:00

(main): Handle argc < optind.

This commit is contained in:
Jim Meyering
2003-05-10 14:33:24 +00:00
parent 007103be2e
commit 8eb2464d3e
+2 -2
View File
@@ -1,5 +1,5 @@
/* install - copy files and set attributes
Copyright (C) 89, 90, 91, 1995-2002 Free Software Foundation, Inc.
Copyright (C) 89, 90, 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
@@ -279,7 +279,7 @@ main (int argc, char **argv)
n_files = argc - optind;
file = argv + optind;
if (n_files == 0 || (n_files == 1 && !dir_arg))
if (argc <= optind || (n_files == 1 && !dir_arg))
{
error (0, 0, _("too few arguments"));
usage (EXIT_FAILURE);