From: Ulrich Drepper Date: Fri, 31 Mar 2000 05:03:53 +0000 (+0000) Subject: Update. X-Git-Tag: upstream/2.30~25962 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=05c54d4c8e2e81c08a0fa220b299dade7c9a622e;p=external%2Fglibc.git Update. 2000-03-30 Ulrich Drepper * posix/getopt.c (_getopt_internal): Return -1 if argc < 1. Reported by Andrew Wiseman (PR libc/1677). --- diff --git a/ChangeLog b/ChangeLog index 8520633..60bb8e1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2000-03-30 Ulrich Drepper + + * posix/getopt.c (_getopt_internal): Return -1 if argc < 1. + Reported by Andrew Wiseman + (PR libc/1677). + 2000-03-30 Andreas Jaeger * misc/sys/cdefs.h: Remove K&R support. diff --git a/posix/getopt.c b/posix/getopt.c index 4744e43..f1add57 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)