summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2016-07-06 13:03:21 +0200
committerLubomir Rintel <lkundrak@v3.sk>2016-08-01 13:52:36 +0200
commit33cd5149f8c9399efdb60f3d4f1ed2d0779a74a7 (patch)
tree04d21963bd5457da4deeb2523f377e0475dd66c3
parent570e8ee29684f16b4306f1eb94a1b756608ddd3b (diff)
downloadNetworkManager-33cd5149f8c9399efdb60f3d4f1ed2d0779a74a7.tar.gz
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.
-rw-r--r--clients/cli/common.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/clients/cli/common.c b/clients/cli/common.c
index 7ac0a7625d..214eb7eb9e 100644
--- a/clients/cli/common.c
+++ b/clients/cli/common.c
@@ -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."));