mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2024-12-28 19:31:19 +08:00
cppchecker fix - might be called with UID == NULL
This commit is contained in:
parent
31df889f97
commit
84bc138841
1 changed files with 6 additions and 5 deletions
|
@ -15,14 +15,15 @@
|
||||||
// uid[] the UID in transmission order
|
// uid[] the UID in transmission order
|
||||||
// return: ptr to string
|
// return: ptr to string
|
||||||
char *iso15693_sprintUID(char *dest, uint8_t *uid) {
|
char *iso15693_sprintUID(char *dest, uint8_t *uid) {
|
||||||
|
|
||||||
static char tempbuf[3 * 8 + 1] = {0};
|
static char tempbuf[3 * 8 + 1] = {0};
|
||||||
if (dest == NULL)
|
if (dest == NULL)
|
||||||
dest = tempbuf;
|
dest = tempbuf;
|
||||||
|
|
||||||
sprintf(dest, "%02X %02X %02X %02X %02X %02X %02X %02X",
|
if (uid) {
|
||||||
uid[7], uid[6], uid[5], uid[4],
|
sprintf(dest, "%02X %02X %02X %02X %02X %02X %02X %02X",
|
||||||
uid[3], uid[2], uid[1], uid[0]
|
uid[7], uid[6], uid[5], uid[4],
|
||||||
);
|
uid[3], uid[2], uid[1], uid[0]
|
||||||
|
);
|
||||||
|
}
|
||||||
return dest;
|
return dest;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue