From: Daniel P. Berrangé Date: Wed, 22 Jul 2020 16:32:54 +0000 (+0100) Subject: tools: be more paranoid about possibly NULL description X-Git-Tag: v6.6.0-rc1~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ec550018104b3b97fc911dcff3b9d690cbb5e58c;p=thirdparty%2Flibvirt.git tools: be more paranoid about possibly NULL description GCC 10 complains about "desc" possibly being a NULL dereference. Even though it is a false positive, we can easily avoid it. Reviewed-by: Laine Stump Signed-off-by: Daniel P. Berrangé --- diff --git a/tools/vsh.c b/tools/vsh.c index 527c135424..b65e99cbd2 100644 --- a/tools/vsh.c +++ b/tools/vsh.c @@ -689,7 +689,7 @@ vshCmddefHelp(vshControl *ctl, const vshCmdDef *def) fputc('\n', stdout); desc = vshCmddefGetInfo(def, "desc"); - if (*desc) { + if (desc && *desc) { /* Print the description only if it's not empty. */ fputs(_("\n DESCRIPTION\n"), stdout); fprintf(stdout, " %s\n", _(desc));