X-Git-Url: http://www.average.org/gitweb/?p=pam_pcsc_cr.git;a=blobdiff_plain;f=test_chalresp.c;h=4f0c3e0aae3de743263296a920f60d407e3bf0f7;hp=5fda704b5652f2e1ad2773cd7328baa6d3201b0a;hb=HEAD;hpb=ee0824354abef3e422c32e931f52b4396263cab1 diff --git a/test_chalresp.c b/test_chalresp.c index 5fda704..2635fea 100644 --- a/test_chalresp.c +++ b/test_chalresp.c @@ -30,7 +30,7 @@ freely, subject to the following restrictions: #include #include "pcsc_cr.h" -static void usage(const char const *cmd) +static void usage(const char *const cmd) { fprintf(stderr, "usage: %s [-o backend:name=value] ... \"challenge\"\n", @@ -40,10 +40,10 @@ static void usage(const char const *cmd) int main(int argc, char *argv[]) { unsigned char chal[64]; - int csize; + size_t csize; unsigned char rbuf[20]; - int rsize = sizeof(rbuf); - int i; + size_t rsize = sizeof(rbuf); + size_t i; long rc; int c; @@ -69,7 +69,7 @@ int main(int argc, char *argv[]) csize = strlen(argv[optind]); if (csize > sizeof(chal)) { fprintf(stderr, "Challenge longer than %d, cannot do that\n", - csize); + (int)csize); exit(1); } #if 0 @@ -85,7 +85,7 @@ int main(int argc, char *argv[]) memset(rbuf, 0xFE, sizeof(rbuf)); rc = pcsc_cr(chal, csize, rbuf, &rsize); - printf("rc=%ld (%s) rsize=%d:", rc, pcsc_errstr(rc), rsize); + printf("rc=%ld (%s) rsize=%d:", rc, pcsc_errstr(rc), (int)rsize); for (i = 0; i < rsize; i++) printf(" %02x", rbuf[i]); printf("\n"); return rc;