diff --git a/libnfc/chips/pn53x.c b/libnfc/chips/pn53x.c index 5e18e7a..362cb4a 100644 --- a/libnfc/chips/pn53x.c +++ b/libnfc/chips/pn53x.c @@ -520,7 +520,6 @@ pn53x_decode_target_data(const uint8_t *pbtRawData, size_t szRawData, pn53x_type pnti->nii.btConfig = *(pbtRawData++); if (pnti->nii.btConfig & 0x40) { memcpy(pnti->nii.abtAtr, pbtRawData, szRawData - 8); - pbtRawData += szRawData - 8; pnti->nii.szAtrLen = szRawData - 8; } } @@ -529,7 +528,6 @@ pn53x_decode_target_data(const uint8_t *pbtRawData, size_t szRawData, pn53x_type case NMT_ISO14443B2SR: // Store the UID memcpy(pnti->nsi.abtUID, pbtRawData, 8); - pbtRawData += 8; break; case NMT_ISO14443B2CT: @@ -541,7 +539,6 @@ pn53x_decode_target_data(const uint8_t *pbtRawData, size_t szRawData, pn53x_type pnti->nci.btFabCode = *(pbtRawData++); // Store UID MSB memcpy(pnti->nci.abtUID + 2, pbtRawData, 2); - pbtRawData += 2; break; case NMT_FELICA: @@ -3077,12 +3074,12 @@ pn53x_get_information_about(nfc_device *pnd, char **pbuf) free(*pbuf); return NFC_ESOFT; } - buf += res; + //buf += res; if (buflen <= (size_t)res) { free(*pbuf); return NFC_EOVFLOW; } - buflen -= res; + //buflen -= res; return NFC_SUCCESS; } diff --git a/libnfc/target-subr.c b/libnfc/target-subr.c index 0c9dd63..9b3640f 100644 --- a/libnfc/target-subr.c +++ b/libnfc/target-subr.c @@ -463,7 +463,7 @@ sprint_nfc_iso14443a_info(char *dst, const nfc_iso14443a_info nai, bool verbose) break; } if (! found_possible_match) { - dst += sprintf(dst, "* Unknown card, sorry\n"); + sprintf(dst, "* Unknown card, sorry\n"); } } } @@ -477,7 +477,7 @@ sprint_nfc_felica_info(char *dst, const nfc_felica_info nfi, bool verbose) dst += sprintf(dst, " Parameter (PAD): "); dst += sprint_hex(dst, nfi.abtPad, 8); dst += sprintf(dst, " System Code (SC): "); - dst += sprint_hex(dst, nfi.abtSysCode, 2); + sprint_hex(dst, nfi.abtSysCode, 2); } void @@ -487,7 +487,7 @@ sprint_nfc_jewel_info(char *dst, const nfc_jewel_info nji, bool verbose) dst += sprintf(dst, " ATQA (SENS_RES): "); dst += sprint_hex(dst, nji.btSensRes, 2); dst += sprintf(dst, " 4-LSB JEWELID: "); - dst += sprint_hex(dst, nji.btId, 4); + sprint_hex(dst, nji.btId, 4); } #define PI_ISO14443_4_SUPPORTED 0x01 @@ -543,7 +543,7 @@ sprint_nfc_iso14443b_info(char *dst, const nfc_iso14443b_info nbi, bool verbose) dst += sprintf(dst, "* Frame options supported: "); if ((nbi.abtProtocolInfo[2] & PI_NAD_SUPPORTED) != 0) dst += sprintf(dst, "NAD "); if ((nbi.abtProtocolInfo[2] & PI_CID_SUPPORTED) != 0) dst += sprintf(dst, "CID "); - dst += sprintf(dst, "\n"); + sprintf(dst, "\n"); } } } @@ -568,7 +568,7 @@ sprint_nfc_iso14443bi_info(char *dst, const nfc_iso14443bi_info nii, bool verbos } if ((nii.btVerLog & 0x80) && (nii.btConfig & 0x40)) { dst += sprintf(dst, " ATS: "); - dst += sprint_hex(dst, nii.abtAtr, nii.szAtrLen); + sprint_hex(dst, nii.abtAtr, nii.szAtrLen); } } @@ -577,7 +577,7 @@ sprint_nfc_iso14443b2sr_info(char *dst, const nfc_iso14443b2sr_info nsi, bool ve { (void) verbose; dst += sprintf(dst, " UID: "); - dst += sprint_hex(dst, nsi.abtUID, 8); + sprint_hex(dst, nsi.abtUID, 8); } void @@ -590,7 +590,7 @@ sprint_nfc_iso14443b2ct_info(char *dst, const nfc_iso14443b2ct_info nci, bool ve dst += sprint_hex(dst, nci.abtUID, sizeof(nci.abtUID)); dst += sprintf(dst, " UID (decimal): %010u\n", uid); dst += sprintf(dst, " Product Code: %02X\n", nci.btProdCode); - dst += sprintf(dst, " Fab Code: %02X\n", nci.btFabCode); + sprintf(dst, " Fab Code: %02X\n", nci.btFabCode); } void @@ -605,7 +605,7 @@ sprint_nfc_dep_info(char *dst, const nfc_dep_info ndi, bool verbose) dst += sprintf(dst, " PP: %02x\n", ndi.btPP); if (ndi.szGB) { dst += sprintf(dst, "General Bytes: "); - dst += sprint_hex(dst, ndi.abtGB, ndi.szGB); + sprint_hex(dst, ndi.abtGB, ndi.szGB); } }