2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 14:07:59 +00:00
This commit is contained in:
Evan Hunt 2018-11-13 16:41:54 -08:00
parent 77128c867c
commit e356d93175

View File

@ -1370,8 +1370,10 @@ preparse_args(int argc, char **argv) {
char *option;
for (argc--, argv++; argc > 0; argc--, argv++) {
if (argv[0][0] != '-')
if (argv[0][0] != '-') {
continue;
}
option = &argv[0][1];
while (strpbrk(option, single_dash_opts) == &option[0]) {
switch (option[0]) {
@ -1394,20 +1396,27 @@ preparse_args(int argc, char **argv) {
}
option = &option[1];
}
if (strlen(option) == 0U) {
continue;
}
/* Look for dash value option. */
if (strpbrk(option, dash_opts) != &option[0] ||
strlen(option) > 1U) {
strlen(option) > 1U)
{
/* Error or value in option. */
continue;
}
/* Dash value is next argument so we need to skip it. */
argc--, argv++;
argc--;
argv++;
/* Handle missing argument */
if (argc == 0)
if (argc == 0) {
break;
}
}
}