1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-20 07:59:00 +00:00

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 <laine@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrangé 2020-07-22 17:32:54 +01:00
parent 5e9d6b3a46
commit ec55001810

View File

@ -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));