From: Michael Gernoth Date: Sat, 13 Jul 2013 16:48:32 +0000 (+0200) Subject: send a full frame containing only zeroes instead of a zero-byte frame X-Git-Tag: v0.100~58 X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/hmcfgusb/commitdiff_plain/3435bdb66e2ea9d3f2be157702b2d116cc45a25f send a full frame containing only zeroes instead of a zero-byte frame --- diff --git a/hmcfgusb.c b/hmcfgusb.c index d086419..d8a442f 100644 --- a/hmcfgusb.c +++ b/hmcfgusb.c @@ -146,8 +146,11 @@ int hmcfgusb_send_null_frame(struct hmcfgusb_dev *usbdev, int silent) { int err; int cnt; + unsigned char out[0x40]; - err = libusb_interrupt_transfer(usbdev->usb_devh, EP_OUT, NULL, 0, &cnt, USB_TIMEOUT); + memset(out, 0, sizeof(out)); + + err = libusb_interrupt_transfer(usbdev->usb_devh, EP_OUT, out, sizeof(out), &cnt, USB_TIMEOUT); if (err && (!silent)) { fprintf(stderr, "Can't send null frame: %s\n", usb_strerror(err)); return 0;