Sophie

Sophie

distrib > Mageia > 9 > armv7hl > media > core-release-src > by-pkgid > 5ab19ee19353899f7cf799d749155278 > files > 2

u3-tool-0.3-9.mga9.src.rpm

Index: src/u3_scsi_usb.c
===================================================================
--- src/u3_scsi_usb.c	(revision 50)
+++ src/u3_scsi_usb.c	(working copy)
@@ -350,7 +350,7 @@
 	} else if (dxfer_direction == CBW_DATA_IN) {
 		if (usb_bulk_read(handle_wrapper->handle, handle_wrapper->ep_in,
 				(char *) dxfer_data, dxfer_length,
-				U3_DEVICE_TIMEOUT) != dxfer_length)
+				U3_DEVICE_TIMEOUT) <= 0)
 		{
 			u3_set_error(device, "Failed executing scsi command: "
 				"Could not read data from device");
@@ -361,7 +361,7 @@
 	// read command status
         if (usb_bulk_read(handle_wrapper->handle, handle_wrapper->ep_in,
 			(char *) &csw, sizeof(csw), U3_DEVICE_TIMEOUT)
-                        != sizeof(csw))
+                        <= 0)
         {
 		u3_set_error(device, "Failed executing scsi command: "
 			"Could not read command status from device");