diff options
author | Jim Meyering <jim@meyering.net> | 2003-05-10 14:33:24 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2003-05-10 14:33:24 +0000 |
commit | 8eb2464d3ef8a04f76a1beae46ab1950b8069b3b (patch) | |
tree | e164986e011b890c46bf566e68e45ae561651e81 | |
parent | 007103be2ea5fb4203898e3b5716681fa957d05b (diff) | |
download | coreutils-8eb2464d3ef8a04f76a1beae46ab1950b8069b3b.tar.xz |
(main): Handle argc < optind.
-rw-r--r-- | src/install.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/install.c b/src/install.c index 0204eadeb..8e4dd98ea 100644 --- a/src/install.c +++ b/src/install.c @@ -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); |