From 5ba50100429f04798f877a09feb69b581a9f4d7f Mon Sep 17 00:00:00 2001 From: Jeremy Boynes Date: Fri, 3 Nov 2023 09:33:36 +0000 Subject: [PATCH] Don't use construtor delegation --- api/CanMsg.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/api/CanMsg.h b/api/CanMsg.h index b26a48b5..cae7cc10 100644 --- a/api/CanMsg.h +++ b/api/CanMsg.h @@ -51,7 +51,11 @@ class CanMsg : public Printable CanMsg() : CanMsg(0, 0, nullptr) { } - CanMsg(CanMsg const & other) : CanMsg(other.id, other.data_length, other.data) { + CanMsg(CanMsg const & other) { + id = other.id; + data_length = other.data_length; + if (data_length > 0) + memcpy(data, other.data, data_length); } virtual ~CanMsg() { }