diff options
author | Pavel Hrdina <phrdina@redhat.com> | 2019-11-13 14:53:42 +0100 |
---|---|---|
committer | Pavel Hrdina <phrdina@redhat.com> | 2019-11-15 15:07:40 +0100 |
commit | 43b01ef2d6611984724e25ae983bf3721ac2f8ef (patch) | |
tree | 2a14e3065f9ea6775ec9afdaa1d8586ab244ba22 /tests/virpcimock.c | |
parent | 8addef2bef0a4c7f42c71a78edfbe27d32e26db1 (diff) | |
download | libvirt-43b01ef2d6611984724e25ae983bf3721ac2f8ef.tar.gz |
replace use of gnulib snprintf by g_snprintf
Glib implementation follows the ISO C99 standard so it's safe to replace
the gnulib implementation.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Diffstat (limited to 'tests/virpcimock.c')
-rw-r--r-- | tests/virpcimock.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/tests/virpcimock.c b/tests/virpcimock.c index 7e4554a1dc..341afb385b 100644 --- a/tests/virpcimock.c +++ b/tests/virpcimock.c @@ -417,9 +417,9 @@ pci_device_create_iommu(const struct pciDevice *dev, if (virFileMakePath(iommuPath) < 0) ABORT("Unable to create: %s", iommuPath); - if (snprintf(tmp, sizeof(tmp), - "../../../../devices/pci%04x:%02x/%s", - dev->addr.domain, dev->addr.bus, devid) < 0) { + if (g_snprintf(tmp, sizeof(tmp), + "../../../../devices/pci%04x:%02x/%s", + dev->addr.domain, dev->addr.bus, devid) < 0) { ABORT("@tmp overflow"); } @@ -512,15 +512,15 @@ pci_device_new_from_stub(const struct pciDevice *data) make_file(devpath, "config", "some dummy config", -1); } - if (snprintf(tmp, sizeof(tmp), "0x%.4x", dev->vendor) < 0) + if (g_snprintf(tmp, sizeof(tmp), "0x%.4x", dev->vendor) < 0) ABORT("@tmp overflow"); make_file(devpath, "vendor", tmp, -1); - if (snprintf(tmp, sizeof(tmp), "0x%.4x", dev->device) < 0) + if (g_snprintf(tmp, sizeof(tmp), "0x%.4x", dev->device) < 0) ABORT("@tmp overflow"); make_file(devpath, "device", tmp, -1); - if (snprintf(tmp, sizeof(tmp), "0x%.4x", dev->klass) < 0) + if (g_snprintf(tmp, sizeof(tmp), "0x%.4x", dev->klass) < 0) ABORT("@tmp overflow"); make_file(devpath, "class", tmp, -1); @@ -528,15 +528,15 @@ pci_device_new_from_stub(const struct pciDevice *data) pci_device_create_iommu(dev, devid); - if (snprintf(tmp, sizeof(tmp), - "../../../kernel/iommu_groups/%d", dev->iommuGroup) < 0) { + if (g_snprintf(tmp, sizeof(tmp), + "../../../kernel/iommu_groups/%d", dev->iommuGroup) < 0) { ABORT("@tmp overflow"); } make_symlink(devpath, "iommu_group", tmp); - if (snprintf(tmp, sizeof(tmp), - "../../../devices/pci%04x:%02x/%s", - dev->addr.domain, dev->addr.bus, devid) < 0) { + if (g_snprintf(tmp, sizeof(tmp), + "../../../devices/pci%04x:%02x/%s", + dev->addr.domain, dev->addr.bus, devid) < 0) { ABORT("@tmp overflow"); } @@ -545,9 +545,9 @@ pci_device_new_from_stub(const struct pciDevice *data) make_symlink(devsympath, devid, tmp); if (dev->physfn) { - if (snprintf(tmp, sizeof(tmp), - "%s%s/devices/%s", fakerootdir, - SYSFS_PCI_PREFIX, dev->physfn) < 0) { + if (g_snprintf(tmp, sizeof(tmp), + "%s%s/devices/%s", fakerootdir, + SYSFS_PCI_PREFIX, dev->physfn) < 0) { ABORT("@tmp overflow"); } make_symlink(devpath, "physfn", tmp); |