Browse files

freenect: initialize the 'transferred' variable used in bulk transfers

This is in order to make the printouts in the error path of the callers
of fnusb_bulk() show a saner value when libusb does not touch the
variable (i.e. when a transfer fails).

Signed-off-by: Antonio Ospite <>
  • Loading branch information...
ao2 authored and zarvox committed Feb 28, 2012
1 parent 7205faa commit 05bca9f5d089133083c4c474bddcf6c8ab63bab0
Showing with 1 addition and 0 deletions.
  1. +1 −0 src/usb_libusb10.c
@@ -575,6 +575,7 @@ FN_INTERNAL int fnusb_control(fnusb_dev *dev, uint8_t bmRequestType, uint8_t bRe
FN_INTERNAL int fnusb_bulk(fnusb_dev *dev, uint8_t endpoint, uint8_t *data, int len, int *transferred) {
+ *transferred = 0;
return libusb_bulk_transfer(dev->dev, endpoint, data, len, transferred, 0);

0 comments on commit 05bca9f

Please sign in to comment.