refactor(option.c): reduce scope or errbuf

This commit is contained in:
Lewis Russell 2023-01-25 15:06:32 +00:00
parent 3ae3e47d54
commit b93bec68bc

View File

@ -1417,8 +1417,6 @@ int do_set(char *arg, int opt_flags)
goto theend;
}
char errbuf[80];
while (*arg != NUL) { // loop to process all options
char *startarg = arg; // remember for error message
@ -1441,6 +1439,8 @@ int do_set(char *arg, int opt_flags)
}
} else {
char *errmsg = NULL;
char errbuf[80];
do_set_option(opt_flags, &arg, &did_show, errbuf, sizeof(errbuf), &errmsg);
// Advance to next argument.