aboutsummaryrefslogtreecommitdiff
path: root/hw/usb/host-linux.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/usb/host-linux.c')
-rw-r--r--hw/usb/host-linux.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/usb/host-linux.c b/hw/usb/host-linux.c
index e8e6a42fb9..ad75ce0702 100644
--- a/hw/usb/host-linux.c
+++ b/hw/usb/host-linux.c
@@ -1314,7 +1314,7 @@ static int usb_host_open(USBHostDevice *dev, int bus_num,
dev->bus_num = bus_num;
dev->addr = addr;
- strcpy(dev->port, port);
+ pstrcpy(dev->port, sizeof(dev->port), port);
dev->fd = fd;
/* read the device description */
@@ -1760,7 +1760,7 @@ static int usb_host_auto_scan(void *opaque, int bus_num,
if (f->addr > 0 && f->addr != addr) {
continue;
}
- if (f->port != NULL && (port == NULL || strcmp(f->port, port) != 0)) {
+ if (f->port != NULL && strcmp(f->port, port) != 0) {
continue;
}