]> git.proxmox.com Git - qemu.git/commitdiff
Avoid asprintf() which is not available on mingw
authorGerd Hoffmann <kraxel@redhat.com>
Mon, 13 Aug 2012 11:05:43 +0000 (13:05 +0200)
committerBlue Swirl <blauwirbel@gmail.com>
Sat, 18 Aug 2012 08:49:27 +0000 (08:49 +0000)
Use g_strdup_printf() instead.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
hw/msix.c

index 800fc32f0b0e54a05637a8b51510aed7c1a9b236..aea340b7c72f13c3d119e653277e02189a919b5d 100644 (file)
--- a/hw/msix.c
+++ b/hw/msix.c
@@ -307,13 +307,9 @@ int msix_init_exclusive_bar(PCIDevice *dev, unsigned short nentries,
         return -EINVAL;
     }
 
-    if (asprintf(&name, "%s-msix", dev->name) == -1) {
-        return -ENOMEM;
-    }
-
+    name = g_strdup_printf("%s-msix", dev->name);
     memory_region_init(&dev->msix_exclusive_bar, name, MSIX_EXCLUSIVE_BAR_SIZE);
-
-    free(name);
+    g_free(name);
 
     ret = msix_init(dev, nentries, &dev->msix_exclusive_bar, bar_nr,
                     MSIX_EXCLUSIVE_BAR_TABLE_OFFSET, &dev->msix_exclusive_bar,