From: michael Date: Sun, 29 Apr 2007 16:00:49 +0000 (+0000) Subject: correctly handle cases where the usb chunksize is smaller than the X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/usb-driver/commitdiff_plain/85690a3f9979e3614e46847053a60289eb990ef0?ds=sidebyside;hp=4af4753dc42ce756e91d803da1824478e11695f0 correctly handle cases where the usb chunksize is smaller than the combined write --- diff --git a/jtagkey.c b/jtagkey.c index 2be1954..b06b6b4 100644 --- a/jtagkey.c +++ b/jtagkey.c @@ -114,9 +114,9 @@ int jtagkey_transfer(WD_TRANSFER *tr, int fd, unsigned int request, int ppbase, int len; DPRINTF("writing %d bytes due to %d following reads in %d chunks or full buffer\n", writepos-writebuf, nread, num); - len = writepos-pos; - while (pos < writepos) { + len = writepos-pos; + if (len > usb_maxlen) len = usb_maxlen;