mirror of
https://github.com/nfc-tools/libnfc.git
synced 2026-02-28 04:36:41 +00:00
Fix cppcheck style: scope of variable can be reduced
Fix the following cppcheck warnings: [libnfc/drivers/pn532_uart.c:492]: (style) The scope of the variable 'res' can be reduced [libnfc/chips/pn53x.c:320]: (style) The scope of the variable 'res' can be reduced [libnfc/chips/pn53x.c:616]: (style) The scope of the variable 'res' can be reduced [libnfc/nfc.c:356]: (style) The scope of the variable '_device_found' can be reduced [utils/nfc-mfclassic.c:178]: (style) The scope of the variable 'key_index' can be reduced
This commit is contained in:
@@ -175,7 +175,6 @@ authenticate(uint32_t uiBlock)
|
||||
{
|
||||
mifare_cmd mc;
|
||||
uint32_t uiTrailerBlock;
|
||||
size_t key_index;
|
||||
|
||||
// Set the authentication information (uid)
|
||||
memcpy(mp.mpa.abtAuthUid, nt.nti.nai.abtUid + nt.nti.nai.szUidLen - 4, 4);
|
||||
@@ -200,7 +199,7 @@ authenticate(uint32_t uiBlock)
|
||||
return true;
|
||||
} else {
|
||||
// Try to guess the right key
|
||||
for (key_index = 0; key_index < num_keys; key_index++) {
|
||||
for (size_t key_index = 0; key_index < num_keys; key_index++) {
|
||||
memcpy(mp.mpa.abtKey, keys + (key_index * 6), 6);
|
||||
if (nfc_initiator_mifare_cmd(pnd, mc, uiBlock, &mp)) {
|
||||
if (bUseKeyA)
|
||||
|
||||
Reference in New Issue
Block a user