From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:43535) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SzpF0-0000tz-27 for qemu-devel@nongnu.org; Fri, 10 Aug 2012 09:27:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SzpEn-0006pu-QP for qemu-devel@nongnu.org; Fri, 10 Aug 2012 09:27:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:17703) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SzpEn-0006oW-I5 for qemu-devel@nongnu.org; Fri, 10 Aug 2012 09:26:49 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q7ADQllY028897 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 10 Aug 2012 09:26:47 -0400 From: Gerd Hoffmann Date: Fri, 10 Aug 2012 15:26:44 +0200 Message-Id: <1344605205-28583-2-git-send-email-kraxel@redhat.com> In-Reply-To: <1344605205-28583-1-git-send-email-kraxel@redhat.com> References: <1344605205-28583-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 1/2] avoid asprintf (not available on mingw64) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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); -- 1.7.1