diff options
author | Jim Meyering <jim@meyering.net> | 2003-05-10 13:25:41 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2003-05-10 13:25:41 +0000 |
commit | 3de521ebf928574ee11e96cf1b9e57d31727c871 (patch) | |
tree | 1da32da218267eed5fd8202c061c3f1a25fde4b1 /src | |
parent | 9f763671c07592bba130399e71a6fd42a41276c8 (diff) | |
download | coreutils-3de521ebf928574ee11e96cf1b9e57d31727c871.tar.xz |
(main): Test for `missing argument' before computing n_files.
Diffstat (limited to 'src')
-rw-r--r-- | src/ln.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -482,15 +482,15 @@ main (int argc, char **argv) } } - n_files = argc - optind; - file = argv + optind; - - if (n_files == 0) + if (argc <= optind) { error (0, 0, _("missing file argument")); usage (EXIT_FAILURE); } + n_files = argc - optind; + file = argv + optind; + target_directory_specified = (target_directory != NULL); if (!target_directory) target_directory = file[n_files - 1]; |