[PATCH 1/2] util: use g_vsnprintf

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

 



Instead of vsnprintf from gnulib, use g_vsnprintf from GLib.

Signed-off-by: Ján Tomko <jtomko@xxxxxxxxxx>
---
 src/util/virerror.c      | 4 ++--
 src/util/virtypedparam.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/util/virerror.c b/src/util/virerror.c
index 54cd5b64b9..bf79a8aec7 100644
--- a/src/util/virerror.c
+++ b/src/util/virerror.c
@@ -1288,7 +1288,7 @@ void virReportErrorHelper(int domcode,
 
     if (fmt) {
         va_start(args, fmt);
-        vsnprintf(errorMessage, sizeof(errorMessage)-1, fmt, args);
+        g_vsnprintf(errorMessage, sizeof(errorMessage)-1, fmt, args);
         va_end(args);
     } else {
         errorMessage[0] = '\0';
@@ -1358,7 +1358,7 @@ void virReportSystemErrorFull(int domcode,
         int n;
 
         va_start(args, fmt);
-        n = vsnprintf(msgDetailBuf, sizeof(msgDetailBuf), fmt, args);
+        n = g_vsnprintf(msgDetailBuf, sizeof(msgDetailBuf), fmt, args);
         va_end(args);
 
         size_t len = strlen(errnoDetail);
diff --git a/src/util/virtypedparam.c b/src/util/virtypedparam.c
index 4ad2ed455f..603fcf213a 100644
--- a/src/util/virtypedparam.c
+++ b/src/util/virtypedparam.c
@@ -764,7 +764,7 @@ virTypedParamSetNameVPrintf(virTypedParameterPtr par,
                             const char *fmt,
                             va_list ap)
 {
-    if (vsnprintf(par->field, VIR_TYPED_PARAM_FIELD_LENGTH, fmt, ap) > VIR_TYPED_PARAM_FIELD_LENGTH) {
+    if (g_vsnprintf(par->field, VIR_TYPED_PARAM_FIELD_LENGTH, fmt, ap) > VIR_TYPED_PARAM_FIELD_LENGTH) {
         virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Field name too long"));
         return -1;
     }
-- 
2.21.0

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




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux