[Pcsclite-cvs-commit] CVS Drivers/ccid/src

CVS User rousseau ludovic.rousseau@free.fr
Wed, 08 Sep 2004 14:48:30 -0600


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

Modified Files:
	ccid.c 
Log Message:
ccid_open_hack(): do not use a null terminated C string for the
TPDU->APDU switch command since the command is NOT a C string


--- /cvsroot/pcsclite/Drivers/ccid/src/ccid.c	2004/08/06 11:56:07	1.12
+++ /cvsroot/pcsclite/Drivers/ccid/src/ccid.c	2004/09/08 20:48:30	1.13
@@ -18,7 +18,7 @@
 */
 
 /*
- * $Id: ccid.c,v 1.12 2004/08/06 11:56:07 rousseau Exp $
+ * $Id: ccid.c,v 1.13 2004/09/08 20:48:30 rousseau Exp $
  */
 
 #include <stdio.h>
@@ -58,11 +58,11 @@
 			/* Reader announces TPDU but can do APDU */
 			if (DriverOptions & DRIVER_OPTION_GEMPC_TWIN_KEY_APDU)
 			{
-				unsigned char cmd[] = "\xA0\x02";
+				unsigned char cmd[] = { 0xA0, 0x02 };
 				unsigned char res[10];
 				unsigned int length_res = sizeof(res);
 
-				if (CmdEscape(reader_index, cmd, sizeof(cmd)-1, res, &length_res) == IFD_SUCCESS)
+				if (CmdEscape(reader_index, cmd, sizeof(cmd), res, &length_res) == IFD_SUCCESS)
 				{
 					ccid_descriptor->dwFeatures &= ~CCID_CLASS_EXCHANGE_MASK;
 					ccid_descriptor->dwFeatures |= CCID_CLASS_SHORT_APDU;