made some things better readable
git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@358 96b47cad-a561-4643-ad3b-153ac7d7599c
This commit is contained in:
@@ -45,6 +45,7 @@ int picc_encode_rapdu(const unsigned char *inbuf, size_t inlen,
|
|||||||
if (!inbuf || inlen > 0xffff || !outbuf)
|
if (!inbuf || inlen > 0xffff || !outbuf)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
/* length with ':' + for each byte ' ' with hex + '\0' */
|
||||||
length = 5+inlen*3+1;
|
length = 5+inlen*3+1;
|
||||||
p = realloc(*outbuf, length);
|
p = realloc(*outbuf, length);
|
||||||
if (!p) {
|
if (!p) {
|
||||||
@@ -62,7 +63,7 @@ int picc_encode_rapdu(const unsigned char *inbuf, size_t inlen,
|
|||||||
/* let p point behind ':' to write hex encoded bytes */
|
/* let p point behind ':' to write hex encoded bytes */
|
||||||
p += 5;
|
p += 5;
|
||||||
while (inbuf+inlen > next) {
|
while (inbuf+inlen > next) {
|
||||||
sprintf(p," %02X",*next);
|
sprintf(p, " %02X", *next);
|
||||||
next++;
|
next++;
|
||||||
p += 3;
|
p += 3;
|
||||||
}
|
}
|
||||||
@@ -187,7 +188,7 @@ static int picc_receive_capdu(driver_data_t *driver_data,
|
|||||||
if (fflush(data->fd) != 0)
|
if (fflush(data->fd) != 0)
|
||||||
ERROR("Warning, fflush failed: %s\n", strerror(errno));
|
ERROR("Warning, fflush failed: %s\n", strerror(errno));
|
||||||
|
|
||||||
DEBUG("%s\n", data->buf);
|
DEBUG("%s", data->buf);
|
||||||
|
|
||||||
|
|
||||||
/* decode C-APDU */
|
/* decode C-APDU */
|
||||||
|
|||||||
Reference in New Issue
Block a user