Received: from eggs.gnu.org ([208.118.235.92]:50065) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Szq3C-0001Rk-5L for qemu-devel@nongnu.org; Fri, 10 Aug 2012 10:18:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Szq3B-0002BR-7U for qemu-devel@nongnu.org; Fri, 10 Aug 2012 10:18:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:29669) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Szq3A-0002BC-Vj for qemu-devel@nongnu.org; Fri, 10 Aug 2012 10:18:53 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q7AEIpox003254 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 10 Aug 2012 10:18:51 -0400 From: Markus Armbruster References: <1344605205-28583-1-git-send-email-kraxel@redhat.com> <1344605205-28583-2-git-send-email-kraxel@redhat.com> Date: Fri, 10 Aug 2012 16:18:49 +0200 In-Reply-To: <1344605205-28583-2-git-send-email-kraxel@redhat.com> (Gerd Hoffmann's message of "Fri, 10 Aug 2012 15:26:44 +0200") Message-ID: <87fw7u3k52.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH 1/2] avoid asprintf (not available on mingw64) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: qemu-devel@nongnu.org Gerd Hoffmann writes: > 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); What about g_strdup_printf()?