summaryrefslogtreecommitdiffstats
path: root/Linux_x86/phOsalNfc.c
diff options
context:
space:
mode:
Diffstat (limited to 'Linux_x86/phOsalNfc.c')
-rw-r--r--Linux_x86/phOsalNfc.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/Linux_x86/phOsalNfc.c b/Linux_x86/phOsalNfc.c
index db336f1..0544309 100644
--- a/Linux_x86/phOsalNfc.c
+++ b/Linux_x86/phOsalNfc.c
@@ -160,16 +160,15 @@ void phOsalNfc_RaiseException(phOsalNfc_ExceptionType_t eExceptionType, uint16_t
*/
void phOsalNfc_PrintData(const char *pString, uint32_t length, uint8_t *pBuffer)
{
- char print_buffer[512]; // Max length 512 for the download mode
+ char print_buffer[length * 3 + 1];
int i;
- if(NULL!=pString && length > 1 && length < 34)
- {
- print_buffer[0] = '\0';
- for (i = 0; i < length; i++) {
- snprintf(&print_buffer[i*5], 6, " 0x%02X", pBuffer[i]);
- }
- LOGD("> NFC %s: %s", pString, print_buffer);
+ if (pString == NULL) {
+ pString = "";
+ }
+ print_buffer[0] = '\0';
+ for (i = 0; i < length; i++) {
+ snprintf(&print_buffer[i*3], 4, " %02X", pBuffer[i]);
}
+ LOGD("> %s:%s", pString, print_buffer);
}
-