mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-22 06:13:51 -07:00
simplify logic
This commit is contained in:
parent
be507e1662
commit
620e5f4951
1 changed files with 10 additions and 34 deletions
|
@ -660,7 +660,6 @@ static uint16_t printTraceLine(uint16_t tracepos, uint16_t traceLen, uint8_t *tr
|
||||||
|
|
||||||
char *cb_str = str_dup(pos1 + 1);
|
char *cb_str = str_dup(pos1 + 1);
|
||||||
|
|
||||||
if (hdr->isResponse) {
|
|
||||||
if (g_session.supports_colors) {
|
if (g_session.supports_colors) {
|
||||||
if (crcStatus == 0) {
|
if (crcStatus == 0) {
|
||||||
snprintf(pos1, 24, AEND " " _RED_("%s"), cb_str);
|
snprintf(pos1, 24, AEND " " _RED_("%s"), cb_str);
|
||||||
|
@ -670,17 +669,6 @@ static uint16_t printTraceLine(uint16_t tracepos, uint16_t traceLen, uint8_t *tr
|
||||||
} else {
|
} else {
|
||||||
snprintf(pos1, 9, "[%s]", cb_str);
|
snprintf(pos1, 9, "[%s]", cb_str);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
if (g_session.supports_colors) {
|
|
||||||
if (crcStatus == 0) {
|
|
||||||
snprintf(pos1, 24, AEND " " _RED_("%s"), cb_str);
|
|
||||||
} else {
|
|
||||||
snprintf(pos1, 24, AEND " " _GREEN_("%s"), cb_str);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
snprintf(pos1, 9, "[%s]", cb_str);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// odd case of second crc byte is alone in a new line
|
// odd case of second crc byte is alone in a new line
|
||||||
if (strlen(cb_str) < 5) {
|
if (strlen(cb_str) < 5) {
|
||||||
|
@ -690,7 +678,6 @@ static uint16_t printTraceLine(uint16_t tracepos, uint16_t traceLen, uint8_t *tr
|
||||||
pos1 = line[((data_len - 2) / TRACE_MAX_HEX_BYTES) + 1];
|
pos1 = line[((data_len - 2) / TRACE_MAX_HEX_BYTES) + 1];
|
||||||
cb_str = str_dup(pos1);
|
cb_str = str_dup(pos1);
|
||||||
|
|
||||||
if (hdr->isResponse) {
|
|
||||||
if (g_session.supports_colors) {
|
if (g_session.supports_colors) {
|
||||||
if (crcStatus == 0) {
|
if (crcStatus == 0) {
|
||||||
snprintf(pos1, 24, _RED_("%s"), cb_str);
|
snprintf(pos1, 24, _RED_("%s"), cb_str);
|
||||||
|
@ -700,17 +687,6 @@ static uint16_t printTraceLine(uint16_t tracepos, uint16_t traceLen, uint8_t *tr
|
||||||
} else {
|
} else {
|
||||||
snprintf(pos1, 9, "[%s]", cb_str);
|
snprintf(pos1, 9, "[%s]", cb_str);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
if (g_session.supports_colors) {
|
|
||||||
if (crcStatus == 0) {
|
|
||||||
snprintf(pos1, 24, _RED_("%s"), cb_str);
|
|
||||||
} else {
|
|
||||||
snprintf(pos1, 24, _GREEN_("%s"), cb_str);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
snprintf(pos1, 9, "[%s]", cb_str);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
free(cb_str);
|
free(cb_str);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue