From 34df07ab8f5542eda697c4550528c25e36328d2c Mon Sep 17 00:00:00 2001 From: Gabriel Toffanetto Date: Tue, 23 Sep 2025 20:25:44 -0300 Subject: [PATCH] Fixing truncation of data in 24 bytes due use sizeof instead of size(). --- io_context/include/msg_converters/udp_msgs.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/io_context/include/msg_converters/udp_msgs.hpp b/io_context/include/msg_converters/udp_msgs.hpp index fb1b3e2..fe63a33 100644 --- a/io_context/include/msg_converters/udp_msgs.hpp +++ b/io_context/include/msg_converters/udp_msgs.hpp @@ -21,7 +21,7 @@ #include #include - +#include namespace drivers { @@ -34,7 +34,7 @@ namespace common */ inline void from_msg(const udp_msgs::msg::UdpPacket::SharedPtr & in, std::vector & out) { - out.resize(sizeof(in->data)); + out.resize(in->data.size()); std::copy(in->data.begin(), in->data.end(), out.begin()); }