[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH] avoid format string warnings



>From f06595fb110e1e5a4c4f6ea8c729da3341f89ac4 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering redhat com>
Date: Fri, 14 Nov 2008 13:19:29 +0100
Subject: [PATCH] avoid format string warnings

* src/openvz_driver.c (ADD_ARG_LIT): Add "%s" arg before _(...).
* src/qemu_driver.c (PCI_ATTACH_OK_MSG): Likewise.
* src/util.c (virExec, virRun): Likewise.
---
 src/openvz_driver.c |    4 ++--
 src/qemu_driver.c   |    2 +-
 src/util.c          |    4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/openvz_driver.c b/src/openvz_driver.c
index 48ffa13..95631ee 100644
--- a/src/openvz_driver.c
+++ b/src/openvz_driver.c
@@ -426,7 +426,7 @@ openvzDomainSetNetwork(virConnectPtr conn, const char *vpsid,
         dev_name_ve = openvzGenerateContainerVethName(veid);
         if (dev_name_ve == NULL) {
            openvzError(conn, VIR_ERR_INTERNAL_ERROR,
-                    _("Could not generate eth name for container"));
+                       "%s", _("Could not generate eth name for container"));
            rc = -1;
            goto exit;
         }
@@ -437,7 +437,7 @@ openvzDomainSetNetwork(virConnectPtr conn, const char *vpsid,
             net->ifname = openvzGenerateVethName(veid, dev_name_ve);
             if (net->ifname == NULL) {
                openvzError(conn, VIR_ERR_INTERNAL_ERROR,
-                        _("Could not generate veth name"));
+                           "%s", _("Could not generate veth name"));
                rc = -1;
                VIR_FREE(dev_name_ve);
                goto exit;
diff --git a/src/qemu_driver.c b/src/qemu_driver.c
index 8291bfe..47167b7 100644
--- a/src/qemu_driver.c
+++ b/src/qemu_driver.c
@@ -2611,7 +2611,7 @@ static int qemudDomainAttachPciDiskDevice(virDomainPtr dom, virDomainDeviceDefPt
         s += strlen(PCI_ATTACH_OK_MSG);

         if (virStrToLong_i ((const char*)s, &dummy, 10, &dev->data.disk->slotnum) == -1)
-            qemudLog(QEMUD_WARN, _("Unable to parse slot number\n"));
+            qemudLog(QEMUD_WARN, "%s", _("Unable to parse slot number\n"));
     } else {
         qemudReportError (dom->conn, dom, NULL, VIR_ERR_OPERATION_FAILED,
                           _("adding %s disk failed"), type);
diff --git a/src/util.c b/src/util.c
index 6141847..9b1c5f4 100644
--- a/src/util.c
+++ b/src/util.c
@@ -406,7 +406,7 @@ virExec(virConnectPtr conn,
     char *argv_str;

     if ((argv_str = virArgvToString(argv)) == NULL) {
-        ReportError(conn, VIR_ERR_NO_MEMORY, _("command debug string"));
+        ReportError(conn, VIR_ERR_NO_MEMORY, "%s", _("command debug string"));
         return -1;
     }
     DEBUG0(argv_str);
@@ -523,7 +523,7 @@ virRun(virConnectPtr conn,
     char *argv_str = NULL;

     if ((argv_str = virArgvToString(argv)) == NULL) {
-        ReportError(conn, VIR_ERR_NO_MEMORY, _("command debug string"));
+        ReportError(conn, VIR_ERR_NO_MEMORY, "%s", _("command debug string"));
         goto error;
     }
     DEBUG0(argv_str);
--
1.6.0.4.911.gc990


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]