Make tdadmin handle only one parameter w/o crashing

Fixes SIGSEGV when running tdadmin - (ticket #194).
This commit is contained in:
Erik Johansson 2012-03-21 16:20:23 +01:00
parent 5492623ecd
commit 3bedad336a

View file

@ -47,6 +47,9 @@ static error_t parse_opt (int key, char *arg, struct argp_state *state) {
argp_usage (state);
case ARGP_KEY_ARG:
if (state->next == state->argc) {
argp_usage (state);
}
command = arg;
action = state->argv[state->next];
state->next = state->argc;