* libc/libc/stdlib/getopt.c (getopt_internal): Fix NULL pointer access.

This commit is contained in:
Corinna Vinschen
2013-11-12 11:30:32 +00:00
parent 4146cc5ce7
commit f1359420da
2 changed files with 8 additions and 0 deletions

View File

@ -269,6 +269,10 @@ getopt_internal (int argc, char *const argv[], const char *shortopts,
break;
}
}
/* End of option list? */
if (argv[data->optind] == 0)
return EOF;
/* we've got an option, so parse it */
/* first, is it a long option? */