[libvirt] [PATCH] tools: Fix printf format

Michal Privoznik posted 1 patch 5 years, 6 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/43749000406bef49fbd8fcddefae45414856d50e.1537789225.git.mprivozn@redhat.com
Test syntax-check passed
tools/virsh-domain.c | 2 +-
tools/virt-admin.c   | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
[libvirt] [PATCH] tools: Fix printf format
Posted by Michal Privoznik 5 years, 6 months ago
We're passing size_t but using format for unsigned long.
Introduced in latest vshTable rework patches.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---

Pushed under build breaker and trivial rules.

 tools/virsh-domain.c | 2 +-
 tools/virt-admin.c   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 2a416b919a..cfb0095333 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -6949,7 +6949,7 @@ virshVcpuPinQuery(vshControl *ctl,
             if (!(pinInfo = virBitmapDataFormat(cpumap, cpumaplen)))
                 goto cleanup;
 
-            if (virAsprintf(&vcpuStr, "%lu", i) < 0)
+            if (virAsprintf(&vcpuStr, "%zu", i) < 0)
                 goto cleanup;
 
             if (vshTableRowAppend(table, vcpuStr, pinInfo, NULL) < 0)
diff --git a/tools/virt-admin.c b/tools/virt-admin.c
index ce74489edf..77928ddb80 100644
--- a/tools/virt-admin.c
+++ b/tools/virt-admin.c
@@ -398,7 +398,7 @@ cmdSrvList(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
 
     for (i = 0; i < nsrvs; i++) {
         VIR_AUTOFREE(char *) idStr = NULL;
-        if (virAsprintf(&idStr, "%lu", i) < 0)
+        if (virAsprintf(&idStr, "%zu", i) < 0)
             goto cleanup;
 
         if (vshTableRowAppend(table,
-- 
2.16.4

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