Skip to content

Commit

Permalink
Avoid asprintf() which is not available on mingw
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
kraxel authored and blueswirl committed Aug 18, 2012
1 parent 731dc9e commit 5f893b4
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions hw/msix.c
Expand Up @@ -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,
Expand Down

0 comments on commit 5f893b4

Please sign in to comment.