On Fri, Sep 16, 2016 at 12:50:39PM +0200, Erik Skultety wrote:
If the initial check is true the function immediately returns so there's no
need to enclose the code following the check within an 'else' block.
Also, by removing the 'else' block, the declarations need to be moved to
beginning of the function block to conform with our guidelines.

Signed-off-by: Erik Skultety <eskul...@redhat.com>
---
tools/vsh.c | 222 ++++++++++++++++++++++++++++++------------------------------
1 file changed, 111 insertions(+), 111 deletions(-)

diff --git a/tools/vsh.c b/tools/vsh.c
index 3772d92..4c63bd3 100644
--- a/tools/vsh.c
+++ b/tools/vsh.c
@@ -624,131 +624,131 @@ bool
vshCmddefHelp(vshControl *ctl, const char *cmdname)
{
    const vshCmdDef *def = vshCmddefSearch(cmdname);
+    /* Don't translate desc if it is "".  */
+    const char *desc = vshCmddefGetInfo(def, "desc");
+    const char *help = _(vshCmddefGetInfo(def, "help"));

This introduces a NULL defererence if the command does not exist.

ACK with that fixed.

Jan

Attachment: signature.asc
Description: Digital signature

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to