Avoid asprintf() which is not available on mingw

Use g_strdup_printf() instead.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This commit is contained in:
Gerd Hoffmann 2012-08-13 13:05:43 +02:00 committed by Blue Swirl
parent 731dc9ecd4
commit 5f893b4e9c
1 changed files with 2 additions and 6 deletions

View File

@ -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,