mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-02-12 18:25:07 +08:00
wiegand: use ARRAYLEN
This commit is contained in:
parent
f76814ca97
commit
e54edfd8db
1 changed files with 2 additions and 1 deletions
|
@ -8,6 +8,7 @@
|
|||
// HID card format packing/unpacking routines
|
||||
//-----------------------------------------------------------------------------
|
||||
#include "wiegand_formats.h"
|
||||
#include "commonutil.h"
|
||||
|
||||
bool Pack_H10301(wiegand_card_t *card, wiegand_message_t *packed) {
|
||||
memset(packed, 0, sizeof(wiegand_message_t));
|
||||
|
@ -643,7 +644,7 @@ int HIDFindCardFormat(const char *format) {
|
|||
bool HIDPack(int format_idx, wiegand_card_t *card, wiegand_message_t *packed) {
|
||||
memset(packed, 0, sizeof(wiegand_message_t));
|
||||
|
||||
if (format_idx < 0 || format_idx >= (sizeof(FormatTable) / sizeof(FormatTable[0])))
|
||||
if (format_idx < 0 || format_idx >= ARRAYLEN(FormatTable))
|
||||
return false;
|
||||
|
||||
return FormatTable[format_idx].Pack(card, packed);
|
||||
|
|
Loading…
Reference in a new issue