From 7eac4818abd4d3811bcb21d39d3ab4b980e2aca0 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Mon, 30 Dec 2019 21:19:51 +0100 Subject: [PATCH] cppcheck --- armsrc/mifarecmd.c | 8 ++++---- armsrc/mifarecmd.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/armsrc/mifarecmd.c b/armsrc/mifarecmd.c index 643454672..ec561df3d 100644 --- a/armsrc/mifarecmd.c +++ b/armsrc/mifarecmd.c @@ -1727,13 +1727,13 @@ void MifareEMemGet(uint8_t blockno, uint8_t blockcnt) { // Load a card into the emulator memory // //----------------------------------------------------------------------------- -int MifareECardLoadExt(uint8_t numSectors, uint8_t keyType) { - int retval = MifareECardLoad(numSectors, keyType); +int MifareECardLoadExt(uint8_t sectorcnt, uint8_t keyType) { + int retval = MifareECardLoad(sectorcnt, keyType); reply_ng(CMD_HF_MIFARE_EML_LOAD, retval, NULL, 0); return retval; } -int MifareECardLoad(uint8_t numSectors, uint8_t keyType) { +int MifareECardLoad(uint8_t sectorcnt, uint8_t keyType) { uint32_t cuid = 0; struct Crypto1State mpcs = {0, 0}; @@ -1759,7 +1759,7 @@ int MifareECardLoad(uint8_t numSectors, uint8_t keyType) { goto out; } - for (uint8_t sectorNo = 0; sectorNo < numSectors; sectorNo++) { + for (uint8_t sectorNo = 0; sectorNo < sectorcnt; sectorNo++) { uint64_t ui64Key = emlGetKey(sectorNo, keyType); if (sectorNo == 0) { if (mifare_classic_auth(pcs, cuid, FirstBlockOfSector(sectorNo), keyType, ui64Key, AUTH_FIRST)) { diff --git a/armsrc/mifarecmd.h b/armsrc/mifarecmd.h index 2cb22d28b..5e5e4150e 100644 --- a/armsrc/mifarecmd.h +++ b/armsrc/mifarecmd.h @@ -34,7 +34,7 @@ void MifareEMemClr(void); void MifareEMemSet(uint8_t blockno, uint8_t blockcnt, uint8_t blockwidth, uint8_t *datain); void MifareEMemGet(uint8_t blockno, uint8_t blockcnt); int MifareECardLoad(uint8_t sectorcnt, uint8_t keytype); -int MifareECardLoadExt(uint8_t numSectors, uint8_t keyType); +int MifareECardLoadExt(uint8_t sectorcnt, uint8_t keyType); void MifareCSetBlock(uint32_t arg0, uint32_t arg1, uint8_t *datain); // Work with "magic Chinese" card void MifareCGetBlock(uint32_t arg0, uint32_t arg1, uint8_t *datain);