SLCAN: Fix incorrect format identifier in print function

This commit is contained in:
Jari van Ewijk 2021-09-17 13:44:59 +02:00 committed by Xiang Xiao
parent d8757a6bcf
commit 7cbe2db2c9

View File

@ -258,20 +258,20 @@ int main(int argc, char *argv[])
if (nbytes == CAN_MTU)
{
reccount++;
debug_print("R%d, Id:0x%X\n", reccount, frame.can_id);
debug_print("R%d, Id:0x%lX\n", reccount, frame.can_id);
if (frame.can_id & CAN_EFF_FLAG)
{
/* 29 bit address */
frame.can_id = frame.can_id & ~CAN_EFF_FLAG;
sprintf(sbuf, "T%08X%d", frame.can_id, frame.len);
sprintf(sbuf, "T%08lX%d", frame.can_id, frame.len);
sbp = &sbuf[10];
}
else
{
/* 11 bit address */
sprintf(sbuf, "t%03X%d", frame.can_id, frame.len);
sprintf(sbuf, "t%03lX%d", frame.can_id, frame.len);
sbp = &sbuf[5];
}