Browse Source

cli: fix warnings on uninitialized ret

Alexandre Janniaux 6 years ago
parent
commit
306d5b56f3
  1. 32
      modules/control/cli/cli.c

32
modules/control/cli/cli.c

@ -304,6 +304,12 @@ error: wordfree(&we);
}
size_t count = we.we_wordc;
if (count == 0)
{
ret = VLC_EGENERIC;
goto error;
}
const char **args = vlc_alloc(count, sizeof (*args));
if (unlikely(args == NULL))
{
@ -333,22 +339,20 @@ error: wordfree(&we);
}
#endif
if (count > 0)
{
const struct command **pp = tfind(&args[0], &sys->commands, cmdcmp);
assert(count > 0);
const struct command **pp = tfind(&args[0], &sys->commands, cmdcmp);
if (pp != NULL)
{
const struct command *c = *pp;;
if (pp != NULL)
{
const struct command *c = *pp;;
ret = c->handler.callback(cl, args, count, c->data);
}
else
{
cli_printf(cl, _("Unknown command `%s'. Type `help' for help."),
args[0]);
ret = VLC_EGENERIC;
}
ret = c->handler.callback(cl, args, count, c->data);
}
else
{
cli_printf(cl, _("Unknown command `%s'. Type `help' for help."),
args[0]);
ret = VLC_EGENERIC;
}
#ifdef HAVE_WORDEXP

Loading…
Cancel
Save