From patchwork Fri Aug 10 13:26:44 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [1/2] avoid asprintf (not available on mingw64) Date: Fri, 10 Aug 2012 03:26:44 -0000 From: Gerd Hoffmann X-Patchwork-Id: 176494 Message-Id: <1344605205-28583-2-git-send-email-kraxel@redhat.com> To: qemu-devel@nongnu.org Cc: Gerd Hoffmann Signed-off-by: Gerd Hoffmann --- hw/msix.c | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/hw/msix.c b/hw/msix.c index 800fc32..04345f2 100644 --- a/hw/msix.c +++ b/hw/msix.c @@ -307,9 +307,8 @@ int msix_init_exclusive_bar(PCIDevice *dev, unsigned short nentries, return -EINVAL; } - if (asprintf(&name, "%s-msix", dev->name) == -1) { - return -ENOMEM; - } + name = g_malloc(sizeof(dev->name) + 5); + snprintf(name, sizeof(dev->name) + 5, "%s-msix", dev->name); memory_region_init(&dev->msix_exclusive_bar, name, MSIX_EXCLUSIVE_BAR_SIZE);