diff --git a/drivers/libusb0.c b/drivers/libusb0.c index adf098ba31..e7f16c9003 100644 --- a/drivers/libusb0.c +++ b/drivers/libusb0.c @@ -377,7 +377,7 @@ static int libusb_open(usb_dev_handle **udevp, upsdebug_hex(3, "HID descriptor, method 1", buf, 9); - rdlen1 = buf[7] | (buf[8] << 8); + rdlen1 = (uint8_t)buf[7] | ((uint8_t)buf[8] << 8); } if (rdlen1 < -1) {