From 5f893b4e9c207c5a38cf7b141d2c54fa30046afd Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Mon, 13 Aug 2012 13:05:43 +0200 Subject: [PATCH] Avoid asprintf() which is not available on mingw Use g_strdup_printf() instead. Signed-off-by: Gerd Hoffmann Reviewed-by: Stefan Weil Signed-off-by: Blue Swirl --- hw/msix.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/hw/msix.c b/hw/msix.c index 800fc32..aea340b 100644 --- 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, -- 2.7.4