mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2024-12-28 03:14:53 +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
|
||||
// return: ptr to string
|
||||
char *iso15693_sprintUID(char *dest, uint8_t *uid) {
|
||||
|
||||
static char tempbuf[3 * 8 + 1] = {0};
|
||||
if (dest == NULL)
|
||||
dest = tempbuf;
|
||||
|
||||
sprintf(dest, "%02X %02X %02X %02X %02X %02X %02X %02X",
|
||||
uid[7], uid[6], uid[5], uid[4],
|
||||
uid[3], uid[2], uid[1], uid[0]
|
||||
);
|
||||
if (uid) {
|
||||
sprintf(dest, "%02X %02X %02X %02X %02X %02X %02X %02X",
|
||||
uid[7], uid[6], uid[5], uid[4],
|
||||
uid[3], uid[2], uid[1], uid[0]
|
||||
);
|
||||
}
|
||||
return dest;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue