[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 1/2] Avoid asprintf() which is not available on m
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PATCH v2 1/2] Avoid asprintf() which is not available on mingw |
Date: |
Mon, 13 Aug 2012 13:05:43 +0200 |
Use g_strdup_printf() instead.
Signed-off-by: Gerd Hoffmann <address@hidden>
---
hw/msix.c | 8 ++------
1 files 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,
--
1.7.1