Make tdadmin handle only one parameter w/o crashing
Fixes SIGSEGV when running tdadmin - (ticket #194).
This commit is contained in:
parent
5492623ecd
commit
3bedad336a
1 changed files with 3 additions and 0 deletions
|
@ -47,6 +47,9 @@ static error_t parse_opt (int key, char *arg, struct argp_state *state) {
|
||||||
argp_usage (state);
|
argp_usage (state);
|
||||||
|
|
||||||
case ARGP_KEY_ARG:
|
case ARGP_KEY_ARG:
|
||||||
|
if (state->next == state->argc) {
|
||||||
|
argp_usage (state);
|
||||||
|
}
|
||||||
command = arg;
|
command = arg;
|
||||||
action = state->argv[state->next];
|
action = state->argv[state->next];
|
||||||
state->next = state->argc;
|
state->next = state->argc;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue