X-Git-Url: http://rtime.felk.cvut.cz/gitweb/can-benchmark.git/blobdiff_plain/d2073a52c1ba52749c1c9522c42ccbfc83b70b1d..5cef6d7aff4feea862f119823e6b33d72cb69a34:/latester/latester.c diff --git a/latester/latester.c b/latester/latester.c index b0937ba..a2f4f18 100644 --- a/latester/latester.c +++ b/latester/latester.c @@ -251,8 +251,7 @@ unsigned calc_stuff_bits(struct can_frame *frame) { (!!(frame->can_id & CAN_RTR_FLAG)) << 6 | 0 << 4 | frame->can_dlc & 0xf; - bitmap[2] = htonl(((uint32_t*)frame->data)[0]); - bitmap[3] = htonl(((uint32_t*)frame->data)[1]); + memcpy(&bitmap[2], &frame->data, frame->can_dlc); start = 27; end = 64 + 8*frame->can_dlc; } else { @@ -265,8 +264,7 @@ unsigned calc_stuff_bits(struct can_frame *frame) { (!!(frame->can_id & CAN_RTR_FLAG)) << 6 | 0 << 4 | frame->can_dlc & 0xf; - bitmap[1] = htonl(((uint32_t*)frame->data)[0]); - bitmap[2] = htonl(((uint32_t*)frame->data)[1]); + memcpy(&bitmap[1], &frame->data, frame->can_dlc); start = 13; end = 32 + 8*frame->can_dlc; }