diff --git a/ccid/src/ccid.c b/ccid/src/ccid.c index 3ba9a11..3d1e6e5 100644 --- a/ccid/src/ccid.c +++ b/ccid/src/ccid.c @@ -25,6 +25,7 @@ #include #include #include +#include #include "ccid.h" #include "sslutil.h" @@ -191,7 +192,7 @@ static int get_rapdu(sc_apdu_t *apdu, __u8 **buf, size_t *resplen) goto err; } - if (apdu->sw1 > 0xff || apdu->sw2 > 0xff || apdu->sw1 < 0 || apdu->sw2 < 0) { + if (apdu->sw1 > 0xff || apdu->sw2 > 0xff) { sc_debug(ctx, SC_LOG_DEBUG_VERBOSE, "Received invalid status bytes SW1=%d SW2=%d", apdu->sw1, apdu->sw2); sc_result = SC_ERROR_INVALID_DATA; goto err; diff --git a/pcsc-relay/src/lnfc.c b/pcsc-relay/src/lnfc.c index 58d8097..7c0d818 100644 --- a/pcsc-relay/src/lnfc.c +++ b/pcsc-relay/src/lnfc.c @@ -223,7 +223,7 @@ static int lnfc_send_rapdu(driver_data_t *driver_data, return 0; } if (r < len) - INFO ("Transmitted %d less bytes than desired: %s\n", len-r, nfc_strerror(data->pndTarget)); + INFO ("Transmitted %u less bytes than desired: %s\n", (unsigned int) len-r, nfc_strerror(data->pndTarget)); return 1; diff --git a/pcsc-relay/src/opicc.c b/pcsc-relay/src/opicc.c index 8a3da56..0c2ec91 100644 --- a/pcsc-relay/src/opicc.c +++ b/pcsc-relay/src/opicc.c @@ -61,7 +61,7 @@ int picc_encode_rapdu(const unsigned char *inbuf, size_t inlen, *outlen = length; /* write length of R-APDU */ - sprintf(p, "%04X:", inlen); + sprintf(p, "%0lX:", inlen); /* next points to the next byte to encode */ next = inbuf; @@ -80,7 +80,8 @@ int picc_decode_apdu(const char *inbuf, size_t inlen, unsigned char **outbuf, size_t *outlen) { size_t pos, length; - char *end, *p; + char *end; + unsigned char *p; unsigned long int b; if (!outbuf || !outlen) { @@ -219,7 +220,7 @@ static int picc_receive_capdu(driver_data_t *driver_data, if (fflush(data->fd) != 0) RELAY_ERROR("Warning, fflush failed: %s\n", strerror(errno)); - DEBUG(data->line); + DEBUG("%s", data->line); /* decode C-APDU */ diff --git a/pcsc-relay/src/pcsc-relay.c b/pcsc-relay/src/pcsc-relay.c index 09b533d..1c6940d 100644 --- a/pcsc-relay/src/pcsc-relay.c +++ b/pcsc-relay/src/pcsc-relay.c @@ -212,7 +212,7 @@ err: cleanup(); if (r != SCARD_S_SUCCESS) { - RELAY_ERROR(stringify_error(r)); + RELAY_ERROR("%s\n", stringify_error(r)); exit(1); } diff --git a/virtualsmartcard/src/vpcd/ifd-vpcd.c b/virtualsmartcard/src/vpcd/ifd-vpcd.c index 0ccdca1..caf7a43 100644 --- a/virtualsmartcard/src/vpcd/ifd-vpcd.c +++ b/virtualsmartcard/src/vpcd/ifd-vpcd.c @@ -167,7 +167,7 @@ IFDHPowerICC (DWORD Lun, DWORD Action, PUCHAR Atr, PDWORD AtrLength) } break; default: - Log2(PCSC_LOG_ERROR, "%d not supported", Action); + Log2(PCSC_LOG_ERROR, "%0lX not supported", Action); return IFD_NOT_SUPPORTED; }