fix bad cast done in last revision.

This commit is contained in:
Audrey Diacre 2012-01-05 17:03:38 +00:00
parent 642f9a38f7
commit 601105ef79
6 changed files with 26 additions and 16 deletions

View file

@ -368,9 +368,10 @@ main (int argc, char *argv[])
while (!quitting) {
bool ret;
int res = 0;
if (!initiator_only_mode) {
// Receive external reader command through target
if ((int) ((szCapduLen = (size_t) nfc_target_receive_bytes(pndTarget, abtCapdu, 0))) < 0) {
if ((res = nfc_target_receive_bytes(pndTarget, abtCapdu, 0)) < 0) {
nfc_perror (pndTarget, "nfc_target_receive_bytes");
if (!target_only_mode) {
nfc_disconnect (pndInitiator);
@ -378,6 +379,7 @@ main (int argc, char *argv[])
nfc_disconnect (pndTarget);
exit(EXIT_FAILURE);
}
szCapduLen = (size_t) res;
if (target_only_mode) {
if (print_hex_fd4(abtCapdu, szCapduLen, "C-APDU") != EXIT_SUCCESS) {
fprintf (stderr, "Error while printing C-APDU to FD4\n");