]> www.average.org Git - pam_pcsc_cr.git/blobdiff - test_chalresp.c
configure.ac: remove sanitizer by default
[pam_pcsc_cr.git] / test_chalresp.c
index 5fda704b5652f2e1ad2773cd7328baa6d3201b0a..2635fea99d9b0707c42a8890681202c33b609274 100644 (file)
@@ -30,7 +30,7 @@ freely, subject to the following restrictions:
 #include <string.h>
 #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;