mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-01 01:20:12 +01:00
cli: do not skip over a nonexistent argument in nmc_do_cmd()
If we're called without an argument, don't shift arguments of the callback -- it would be called with argc==-1.
This commit is contained in:
parent
570e8ee296
commit
33cd5149f8
1 changed files with 1 additions and 1 deletions
|
|
@ -1445,7 +1445,7 @@ nmc_do_cmd (NmCli *nmc, const NMCCommand cmds[], const char *cmd, int argc, char
|
|||
}
|
||||
} else if (c->func) {
|
||||
/* No command, run the default handler. */
|
||||
nmc->return_value = c->func (nmc, argc-1, argv+1);
|
||||
nmc->return_value = c->func (nmc, argc, argv);
|
||||
} else {
|
||||
/* No command and no default handler. */
|
||||
g_string_printf (nmc->return_text, _("Error: missing argument. Try passing --help."));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue