diff --git a/api/CanMsg.h b/api/CanMsg.h index eaa3f0ed..3e103c0b 100644 --- a/api/CanMsg.h +++ b/api/CanMsg.h @@ -53,10 +53,10 @@ class CanMsg : public Printable CanMsg(CanMsg const & other) { - this->id = other.id; - this->data_length = other.data_length; - if (this->data_length && other.data) - memcpy(this->data, other.data, this->data_length); + id = other.id; + data_length = other.data_length; + if (data_length > 0) + memcpy(data, other.data, data_length); } virtual ~CanMsg() { } @@ -65,10 +65,10 @@ class CanMsg : public Printable { if (this != &other) { - this->id = other.id; - this->data_length = other.data_length; - if (this->data_length && other.data) - memcpy(this->data, other.data, this->data_length); + id = other.id; + data_length = other.data_length; + if (data_length > 0) + memcpy(data, other.data, data_length); } return (*this); }
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: