diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2012-08-13 13:05:43 +0200 |
---|---|---|
committer | Blue Swirl <blauwirbel@gmail.com> | 2012-08-18 08:49:27 +0000 |
commit | 5f893b4e9c207c5a38cf7b141d2c54fa30046afd (patch) | |
tree | 8cd82bd6b4fce96e1a30a0a9e50ee0795ed27367 /hw/msix.c | |
parent | 731dc9ecd4f2c3041538f7eb2d10eee0cb82da1b (diff) |
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>
Diffstat (limited to 'hw/msix.c')
-rw-r--r-- | hw/msix.c | 8 |
1 files changed, 2 insertions, 6 deletions
@@ -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, |