(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 committed 2003-05-09 08:50:37 +00:00
1 parent 883159c855
commit 6476197bcb
1 file changed
+1 -1
+1 -1
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++];
}