]> git.zerfleddert.de Git - usb-driver/commitdiff
correctly handle cases where the usb chunksize is smaller than the
authormichael <michael>
Sun, 29 Apr 2007 16:00:49 +0000 (16:00 +0000)
committermichael <michael>
Sun, 29 Apr 2007 16:00:49 +0000 (16:00 +0000)
combined write

jtagkey.c

index 2be195451f13f2cbfa1aaa9c10ebd5666c420f8a..b06b6b46bc115a1b7c5dfbb5cf97d32f71349d7c 100644 (file)
--- 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;
 
Impressum, Datenschutz