]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
usb: don't spoil decimal addresses
authorMartin Kletzander <mkletzan@redhat.com>
Fri, 31 May 2013 16:36:11 +0000 (18:36 +0200)
committerCole Robinson <crobinso@redhat.com>
Thu, 11 Jul 2013 21:45:55 +0000 (17:45 -0400)
For USB devices, dev->name gets formated as %.3o:%.3o even though the
numbers are decimal.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=967712
(cherry picked from commit dc0c7915697a902d6edc5820f5930653b7684c3c)

src/util/virusb.c

index 6e43f8efd5096071a183574c82afa008356638fe..f9be5b63c0e4fed869d6bf1a8dc309c8649daebe 100644 (file)
@@ -340,10 +340,10 @@ virUSBDeviceNew(unsigned int bus,
     dev->bus     = bus;
     dev->dev     = devno;
 
-    if (snprintf(dev->name, sizeof(dev->name), "%.3o:%.3o",
+    if (snprintf(dev->name, sizeof(dev->name), "%.3d:%.3d",
                  dev->bus, dev->dev) >= sizeof(dev->name)) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("dev->name buffer overflow: %.3o:%.3o"),
+                       _("dev->name buffer overflow: %.3d:%.3d"),
                        dev->bus, dev->dev);
         virUSBDeviceFree(dev);
         return NULL;