From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:34084) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T0sT1-0006uX-91 for qemu-devel@nongnu.org; Mon, 13 Aug 2012 07:05:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T0sSx-0006mD-PC for qemu-devel@nongnu.org; Mon, 13 Aug 2012 07:05:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:4450) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T0sSx-0006m2-Fo for qemu-devel@nongnu.org; Mon, 13 Aug 2012 07:05:47 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q7DB5k1v005780 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 13 Aug 2012 07:05:47 -0400 From: Gerd Hoffmann Date: Mon, 13 Aug 2012 13:05:43 +0200 Message-Id: <1344855944-28250-2-git-send-email-kraxel@redhat.com> In-Reply-To: <1344855944-28250-1-git-send-email-kraxel@redhat.com> References: <1344855944-28250-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH v2 1/2] Avoid asprintf() which is not available on mingw List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann Use g_strdup_printf() instead. Signed-off-by: Gerd Hoffmann --- 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