git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2455 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
nils 2005-08-02 21:13:06 +00:00
parent 080887c62f
commit 94d899931e
4 changed files with 5 additions and 7 deletions

View File

@ -99,8 +99,6 @@ int sc_base64_encode(const u8 *in, size_t len, u8 *out, size_t outlen, size_t li
size_t i, c;
linelength -= linelength & 0x03;
if (linelength < 0)
return SC_ERROR_INVALID_ARGUMENTS;
while (len >= 3) {
i = in[2] + (in[1] << 8) + (in[0] << 16);
in += 3;

View File

@ -1127,8 +1127,8 @@ static int belpic_read_binary(sc_card_t *card,
if (r == SC_ERROR_INCORRECT_PARAMETERS)
return 0;
if (r >= 0 && r < count)
next_idx = idx + r;
if (r >= 0 && (size_t)r < count)
next_idx = idx + (size_t)r;
dur = t2 - t1;
tot_dur += dur;

View File

@ -93,7 +93,7 @@ static int etoken_init(sc_card_t *card)
return 0;
}
const static struct sc_card_error etoken_errors[] = {
static const struct sc_card_error etoken_errors[] = {
/* some error inside the card */
/* i.e. nothing you can do */
{ 0x6581, SC_ERROR_MEMORY_FAILURE, "EEPROM error; command aborted"},
@ -347,7 +347,7 @@ static int acl_to_byte(const sc_acl_entry_t *e)
case SC_AC_AUT:
if (e->key_ref == SC_AC_KEY_REF_NONE)
return -1;
if (e->key_ref < 0x00 || e->key_ref > 0x7F)
if (e->key_ref > 0x7F)
return -1;
return e->key_ref;
}

View File

@ -24,7 +24,7 @@
#include <ctype.h>
#include <string.h>
const static struct sc_card_error iso7816_errors[] = {
static const struct sc_card_error iso7816_errors[] = {
{ 0x6200, SC_ERROR_MEMORY_FAILURE, "State of non-volatile memory unchanged" },
{ 0x6281, SC_ERROR_MEMORY_FAILURE, "Part of returned data may be corrupted" },
{ 0x6282, SC_ERROR_CARD_CMD_FAILED, "End of file/record reached before reading Le bytes" },