1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-04-13 23:36:10 +02:00

(main): Don't overrun array bound if argc is 0.

That would happen when invoked via: execl ("/usr/bin/sort", NULL);
This commit is contained in:
Jim Meyering
2003-05-09 08:50:37 +00:00
parent 883159c855
commit 6476197bcb

View File

@@ -2265,7 +2265,7 @@ main (int argc, char **argv)
long_options, NULL))
== -1))
{
if (optind == argc)
if (argc < optind)
break;
files[nfiles++] = argv[optind++];
}