Skip to content

Commit 05bca9f

Browse files
Antonio Ospitezarvox
authored andcommitted
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 <[email protected]>
1 parent 7205faa commit 05bca9f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/usb_libusb10.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,7 @@ FN_INTERNAL int fnusb_control(fnusb_dev *dev, uint8_t bmRequestType, uint8_t bRe
575575

576576
#ifdef BUILD_AUDIO
577577
FN_INTERNAL int fnusb_bulk(fnusb_dev *dev, uint8_t endpoint, uint8_t *data, int len, int *transferred) {
578+
*transferred = 0;
578579
return libusb_bulk_transfer(dev->dev, endpoint, data, len, transferred, 0);
579580
}
580581

0 commit comments

Comments
 (0)