From 75adeca7e3fe4eb63bc6b3dfe18445a5a91c69f0 Mon Sep 17 00:00:00 2001 From: Alon Levy Date: Wed, 7 Jul 2010 23:58:09 +0300 Subject: bug fix non default name --- Makefile | 2 +- SCClient.c | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 6059ae0..857f5d7 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,3 @@ -CFLAGS=-I/usr/include/PCSC +CFLAGS=-I/usr/include/PCSC -g LDFLAGS=-lpcsclite all: SCClient diff --git a/SCClient.c b/SCClient.c index ce1034d..2afef4d 100644 --- a/SCClient.c +++ b/SCClient.c @@ -36,7 +36,8 @@ PrintByteArray ( void PrintUsage () { - printf ("SCardClient \n"); + printf ("SCardClient []\n"); + printf ("reader name defaults to: %s\n", ReaderName); } int @@ -82,7 +83,7 @@ WaitForCardInsert () { SCARD_READERSTATE_A rgReaderStates[1]; - rgReaderStates[0].szReader = ReaderName; + rgReaderStates[0].szReader = szReaderName; rgReaderStates[0].dwCurrentState = SCARD_STATE_UNAWARE; rv = SCardGetStatusChange ( @@ -152,7 +153,7 @@ main ( BYTE pbSendBuffer[APDUBufSize]; if (argc == 4) { - szReaderName = argv[2]; + szReaderName = argv[3]; } else { szReaderName = (char *) malloc (strlen (ReaderName)); strncpy ( -- cgit v1.2.3