[Pcsclite-cvs-commit] PCSC/src muscletest.c,1.7,1.8
rousseau@haydn.debian.org
rousseau@haydn.debian.org
Update of /cvsroot/pcsclite/PCSC/src
In directory haydn:/tmp/cvs-serv3032
Modified Files:
muscletest.c
Log Message:
- replace 0 by NULL
- remove some { } for one line blocks
Index: muscletest.c
===================================================================
RCS file: /cvsroot/pcsclite/PCSC/src/muscletest.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- muscletest.c 18 Oct 2003 17:19:36 -0000 1.7
+++ muscletest.c 31 Mar 2004 13:11:27 -0000 1.8
@@ -26,7 +26,6 @@
int main(int argc, char **argv)
{
-
MSCLong32 rv;
MSCTokenConnection pConnection;
MSCStatusInfo statusInf;
@@ -46,7 +45,7 @@
printf("********************************************************\n");
printf("\n");
- tokenList = 0;
+ tokenList = NULL;
tokenSize = 0;
rv = MSCListTokens(MSC_LIST_SLOTS, tokenList, &tokenSize);
@@ -70,12 +69,12 @@
printf("Token #%d\n", i);
printf("Token name : %s\n", tokenList[i].tokenName);
printf("Slot name : %s\n", tokenList[i].slotName);
+
printf("Token id : ");
for (j = 0; j < tokenList[i].tokenIdLength; j++)
- {
printf("%02X", tokenList[i].tokenId[j]);
- }
printf("\n");
+
printf("Token state : %04lX\n", tokenList[i].tokenState);
printf("\n");
@@ -92,12 +91,12 @@
printf("Token #%d\n", i);
printf("Token name : %s\n", tokenList[i].tokenName);
printf("Slot name : %s\n", tokenList[i].slotName);
+
printf("Token id : ");
for (j = 0; j < tokenList[i].tokenIdLength; j++)
- {
printf("%02X", tokenList[i].tokenId[j]);
- }
printf("\n");
+
printf("Token state : %04lX\n", tokenList[i].tokenState);
printf("\n");
@@ -147,8 +146,7 @@
objACL.writePermission = MSC_AUT_ALL;
objACL.deletePermission = MSC_AUT_ALL;
- rv = MSCCreateObject(&pConnection, MY_OBJECT_ID, MY_OBJECT_SIZE,
- &objACL);
+ rv = MSCCreateObject(&pConnection, MY_OBJECT_ID, MY_OBJECT_SIZE, &objACL);
printf("CreateObject returns : %s\n", msc_error(rv));
rv = MSCWriteObject(&pConnection, MY_OBJECT_ID, 0, myData,
@@ -162,12 +160,9 @@
{
printf("Object data : %s\n", readData);
if (strcmp(readData, myData) == 0)
- {
printf("Data comparison : Successful\n");
- } else
- {
+ else
printf("Data comparison : Data mismatch\n");
- }
}
rv = MSCListObjects(&pConnection, MSC_SEQUENCE_RESET, &objInfo);
@@ -198,10 +193,7 @@
objInfo.objectACL.writePermission,
objInfo.objectACL.deletePermission);
} else
- {
break;
- }
-
}
while (1);
@@ -220,12 +212,10 @@
memset(pRandomData, 0, sizeof(pRandomData));
rv = MSCGetChallenge(&pConnection, pSeed, 0, pRandomData, 8);
printf("GetChallenge returns : %s\n", msc_error(rv));
- printf("Random data : ");
+ printf("Random data : ");
for (i = 0; i < 8; i++)
- {
printf("%02X ", pRandomData[i]);
- }
printf("\n");
rv = MSCLogoutAll(&pConnection);
@@ -246,7 +236,6 @@
#ifdef WIN32
MSCString pcsc_stringify_error(MSCLong32 Error)
{
-
static char strError[75];
switch (Error)