Use sizeof instead of constant. --- src/cd-usb-bulk-msd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cd-usb-bulk-msd.c b/src/cd-usb-bulk-msd.c index 61c15a75..ab6644f3 100644 --- a/src/cd-usb-bulk-msd.c +++ b/src/cd-usb-bulk-msd.c @@ -264,7 +264,7 @@ static int parse_usb_msd_cmd(UsbCdBulkMsdDevice *cd, uint8_t *buf, uint32_t cbw_ UsbCdBulkMsdRequest *usb_req = &cd->usb_req; CdScsiRequest *scsi_req = &usb_req->scsi_req; - if (cbw_len != 31) { + if (cbw_len != sizeof(*cbw)) { SPICE_ERROR("CMD: Bad CBW size:%" G_GUINT32_FORMAT, cbw_len); return -1; } -- 2.20.1 _______________________________________________ Spice-devel mailing list Spice-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/spice-devel