marking of crc bytes overwrote first hex char

This commit is contained in:
iceman1001 2021-03-10 14:08:33 +01:00
commit 27dafa2bb0

View file

@ -279,9 +279,9 @@ static uint16_t printTraceLine(uint16_t tracepos, uint16_t traceLen, uint8_t *tr
if (markCRCBytes) { if (markCRCBytes) {
//CRC-command //CRC-command
if (crcStatus == 0 || crcStatus == 1) { if (crcStatus == 0 || crcStatus == 1) {
char *pos1 = line[(data_len - 2) / 18] + (((data_len - 2) % 18) * 4); char *pos1 = line[(data_len - 2) / 18] + (((data_len - 2) % 18) * 4) - 1;
(*pos1) = '['; (*pos1) = '[';
char *pos2 = line[(data_len) / 18] + (((data_len) % 18) * 4); char *pos2 = line[(data_len) / 18] + (((data_len) % 18) * 4) - 1;
sprintf(pos2, "%c", ']'); sprintf(pos2, "%c", ']');
} }
} }