From 34244cc20ddf541a5912ffdb58dbcab6df472f6f Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Mon, 28 Feb 2022 15:00:00 +0100 Subject: [PATCH] virsh: virshVcpuinfoPrintAffinity: Use if-else instead of ternary operator MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Peter Krempa Reviewed-by: Ján Tomko --- tools/virsh-domain.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 732690ec44..73f05ce7f9 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -6721,8 +6721,12 @@ virshVcpuinfoPrintAffinity(vshControl *ctl, return -1; vshPrint(ctl, _("%s (out of %d)"), str, maxcpu); } else { - for (i = 0; i < maxcpu; i++) - vshPrint(ctl, "%c", VIR_CPU_USED(cpumap, i) ? 'y' : '-'); + for (i = 0; i < maxcpu; i++) { + if (VIR_CPU_USED(cpumap, i)) + vshPrint(ctl, "y"); + else + vshPrint(ctl, "-"); + } } vshPrint(ctl, "\n"); -- 2.47.2