Commit d2ebf4a1c99ea3b4985384265920db4a9bf92c66

Con Kolivas 2014-05-31T13:17:13

Add one more usbutils fix

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/usbutils.c b/usbutils.c
index 6c6d902..a15fbc2 100644
--- a/usbutils.c
+++ b/usbutils.c
@@ -2874,7 +2874,7 @@ err_retry:
 		goto err_retry;
 	if (NODEV(err))
 		*transferred = 0;
-	else if ((endpoint & LIBUSB_ENDPOINT_DIR_MASK) == LIBUSB_ENDPOINT_IN)
+	else if ((endpoint & LIBUSB_ENDPOINT_DIR_MASK) == LIBUSB_ENDPOINT_IN && *transferred)
 		cg_memcpy(data, buf, *transferred);
 
 	return err;