]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
(_getopt_internal): Return -1 if argc < 1.
authorUlrich Drepper <drepper@redhat.com>
Fri, 31 Mar 2000 05:04:36 +0000 (05:04 +0000)
committerUlrich Drepper <drepper@redhat.com>
Fri, 31 Mar 2000 05:04:36 +0000 (05:04 +0000)
posix/getopt.c

index 4744e43390ac66c9d46ad35d38460627906c78be..f1add57292895870aa21864a018edba37652c9d6 100644 (file)
@@ -521,6 +521,9 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
   if (optstring[0] == ':')
     print_errors = 0;
 
+  if (argc < 1)
+    return -1;
+
   optarg = NULL;
 
   if (optind == 0 || !__getopt_initialized)