提交 dc0c7915 编写于 作者: M Martin Kletzander

usb: don't spoil decimal addresses

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
上级 4497ef50
...@@ -342,10 +342,10 @@ virUSBDeviceNew(unsigned int bus, ...@@ -342,10 +342,10 @@ virUSBDeviceNew(unsigned int bus,
dev->bus = bus; dev->bus = bus;
dev->dev = devno; 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)) { dev->bus, dev->dev) >= sizeof(dev->name)) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("dev->name buffer overflow: %.3o:%.3o"), _("dev->name buffer overflow: %.3d:%.3d"),
dev->bus, dev->dev); dev->bus, dev->dev);
virUSBDeviceFree(dev); virUSBDeviceFree(dev);
return NULL; return NULL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册