From 57f5262868b8b20b69924e165a0193f27df6de8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1n=20Tomko?= Date: Tue, 12 Feb 2019 17:09:49 +0100 Subject: [PATCH] tools: use NULLSTR_MINUS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use the newly introduced macro in the few places that open-code it. Signed-off-by: Ján Tomko Reviewed-by: Andrea Bolognani --- tools/virsh-domain-monitor.c | 4 ++-- tools/virsh-snapshot.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/virsh-domain-monitor.c b/tools/virsh-domain-monitor.c index 1897a626d5..49de81af8c 100644 --- a/tools/virsh-domain-monitor.c +++ b/tools/virsh-domain-monitor.c @@ -643,11 +643,11 @@ cmdDomblklist(vshControl *ctl, const vshCmd *cmd) "|./source/@volume)", ctxt); if (details) { if (vshTableRowAppend(table, type, device, target, - source ? source : "-", NULL) < 0) + NULLSTR_MINUS(source), NULL) < 0) goto cleanup; } else { if (vshTableRowAppend(table, target, - source ? source : "-", NULL) < 0) + NULLSTR_MINUS(source), NULL) < 0) goto cleanup; } diff --git a/tools/virsh-snapshot.c b/tools/virsh-snapshot.c index 6d8e2b299b..90000ef1aa 100644 --- a/tools/virsh-snapshot.c +++ b/tools/virsh-snapshot.c @@ -945,7 +945,7 @@ cmdSnapshotInfo(vshControl *ctl, const vshCmd *cmd) /* Since we already have the XML, there's no need to call * virDomainSnapshotGetParent */ parent = virXPathString("string(/domainsnapshot/parent/name)", ctxt); - vshPrint(ctl, "%-15s %s\n", _("Parent:"), parent ? parent : "-"); + vshPrint(ctl, "%-15s %s\n", _("Parent:"), NULLSTR_MINUS(parent)); /* Children, Descendants. After this point, the fallback to * compute children is too expensive, so we gracefully quit if the -- GitLab