From 85c987695ba4e539d34b420485487c85dfeceb43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnim=20L=C3=A4uger?= Date: Wed, 9 Jul 2008 19:34:09 +0000 Subject: [PATCH] don't subtract from p->to_recv git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1299 b68d4a1b-bc3d-0410-92ed-d4ac073336b7 --- jtag/ChangeLog | 6 ++++++ jtag/src/tap/usbconn/libftd2xx.c | 3 ++- jtag/src/tap/usbconn/libftdi.c | 3 ++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/jtag/ChangeLog b/jtag/ChangeLog index 7ad220f9..67cafb87 100644 --- a/jtag/ChangeLog +++ b/jtag/ChangeLog @@ -1,3 +1,9 @@ +2008-07-09 Arnim Laeuger + + * src/tap/usbconn/libftd2xx.c (usbconn_ftd2xx_write), + src/tap/usbconn/libftdi.c (usbconn_ftdi_write): don't subtract from + p->to_recv + 2008-07-03 Mike Frysinger * src/lib/ansidecl.h, src/lib/libiberty.h: Import headers from binutils diff --git a/jtag/src/tap/usbconn/libftd2xx.c b/jtag/src/tap/usbconn/libftd2xx.c index 27d21e61..a5edacde 100644 --- a/jtag/src/tap/usbconn/libftd2xx.c +++ b/jtag/src/tap/usbconn/libftd2xx.c @@ -204,7 +204,8 @@ usbconn_ftd2xx_write( usbconn_t *conn, uint8_t *buf, int len, int recv ) { memcpy( &(p->send_buf[p->send_buffered]), buf, len ); p->send_buffered += len; - p->to_recv += recv; + if (recv > 0) + p->to_recv += recv; if (recv < 0) { diff --git a/jtag/src/tap/usbconn/libftdi.c b/jtag/src/tap/usbconn/libftdi.c index 82fe56ac..cc12a15a 100644 --- a/jtag/src/tap/usbconn/libftdi.c +++ b/jtag/src/tap/usbconn/libftdi.c @@ -203,7 +203,8 @@ usbconn_ftdi_write( usbconn_t *conn, uint8_t *buf, int len, int recv ) { memcpy( &(p->send_buf[p->send_buffered]), buf, len ); p->send_buffered += len; - p->to_recv += recv; + if (recv > 0) + p->to_recv += recv; if (recv < 0) {