fixed clang compiler warnings

git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@779 96b47cad-a561-4643-ad3b-153ac7d7599c
This commit is contained in:
frankmorgner
2012-04-24 11:49:31 +00:00
parent bc12ad2d34
commit 6394a961c2
5 changed files with 9 additions and 7 deletions

View File

@@ -25,6 +25,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#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;

View File

@@ -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;

View File

@@ -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 */

View File

@@ -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);
}

View File

@@ -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;
}