do the pointer arithmetic before casting

This commit is contained in:
Kevin Matz 2023-04-09 20:20:17 -04:00
parent 02d4d3a8b8
commit e435e04945

View File

@ -104,7 +104,7 @@ void DmxWidget::parseMessageBuffer()
auto msg = MessageDataFactory((MESSAGE_LABEL)message_rx_buffer_[1], other_side);
// fill it with data
std::shared_ptr<bufferstream> stream(new bufferstream(
reinterpret_cast<uint8_t*>(message_rx_buffer_.data())+fixed_length-1,
reinterpret_cast<uint8_t*>(message_rx_buffer_.data()+fixed_length-1),
length, bufferstream::LittleEndian));
msg->iStream(stream);
// ship it