[Pcsclite-cvs-commit] Drivers/ccid/src ccid_usb.c,1.24,1.25

rousseau@haydn.debian.org rousseau@haydn.debian.org


Update of /cvsroot/pcsclite/Drivers/ccid/src
In directory haydn:/tmp/cvs-serv24742/src

Modified Files:
	ccid_usb.c 
Log Message:
set length to 0 when a usb_bulk_read() error is returned


Index: ccid_usb.c
===================================================================
RCS file: /cvsroot/pcsclite/Drivers/ccid/src/ccid_usb.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- ccid_usb.c	24 May 2004 12:58:43 -0000	1.24
+++ ccid_usb.c	25 May 2004 08:23:20 -0000	1.25
@@ -411,15 +411,17 @@
 
 	rv = usb_bulk_read(usbDevice[reader].handle, usbDevice[reader].bulk_in,
 		(char *)buffer, *length, USB_READ_TIMEOUT);
-	*length = rv;
 
 	if (rv < 0)
 	{
+		*length = 0;
 		DEBUG_CRITICAL4("usb_bulk_read(%s/%s): %s",
 			usbDevice[reader].dev->bus->dirname,
 			usbDevice[reader].dev->filename, strerror(errno));
 		return STATUS_UNSUCCESSFUL;
 	}
+
+	*length = rv;
 
 #ifdef DEBUG_LEVEL_COMM
 	DEBUG_XXD(debug_header, buffer, *length);