[Pcsclite-cvs-commit] r2588 - trunk/PCSC/doc/example

rousseau at alioth.debian.org rousseau at alioth.debian.org
Mon Jul 2 12:59:52 UTC 2007


Author: rousseau
Date: 2007-07-02 12:59:51 +0000 (Mon, 02 Jul 2007)
New Revision: 2588

Modified:
   trunk/PCSC/doc/example/pcsc_demo.c
Log:
use PCSC_ERROR() for SCardListReaders() call


Modified: trunk/PCSC/doc/example/pcsc_demo.c
===================================================================
--- trunk/PCSC/doc/example/pcsc_demo.c	2007-07-02 12:58:50 UTC (rev 2587)
+++ trunk/PCSC/doc/example/pcsc_demo.c	2007-07-02 12:59:51 UTC (rev 2588)
@@ -54,7 +54,7 @@
 	LONG rv;
 	SCARDCONTEXT hContext;
 	DWORD dwReaders;
-	LPSTR mszReaders;
+	LPSTR mszReaders = NULL;
 	char *ptr, **readers = NULL;
 	int nbReaders;
 	SCARDHANDLE hCard;
@@ -89,11 +89,7 @@
 	 * 3. call with the real allocated buffer
 	 */
 	rv = SCardListReaders(hContext, NULL, NULL, &dwReaders);
-	if (rv != SCARD_S_SUCCESS)
-	{
-		printf("SCardListReader: %lX\n", rv);
-		return EXIT_FAILURE;
-	}
+	PCSC_ERROR(rv, "SCardListReaders")
 
 	mszReaders = malloc(sizeof(char)*dwReaders);
 	if (mszReaders == NULL)




More information about the Pcsclite-cvs-commit mailing list