From: Ulrich Drepper Date: Fri, 31 Mar 2000 05:04:36 +0000 (+0000) Subject: (_getopt_internal): Return -1 if argc < 1. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e1844931edb2e04ecc0d655968c5160a959166b4;p=thirdparty%2Fglibc.git (_getopt_internal): Return -1 if argc < 1. --- diff --git a/posix/getopt.c b/posix/getopt.c index 4744e43390a..f1add572928 100644 --- a/posix/getopt.c +++ b/posix/getopt.c @@ -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)