Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2c4e96c

Browse filesBrowse files
authored
Merge pull request #224 from jboynes/can_msg
Fix #217 when compiling with newer compiler versions
2 parents c486627 + 8ffd335 commit 2c4e96c
Copy full SHA for 2c4e96c

File tree

1 file changed

+8
-8
lines changed
Filter options

1 file changed

+8
-8
lines changed

‎api/CanMsg.h

Copy file name to clipboardExpand all lines: api/CanMsg.h
+8-8Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ class CanMsg : public Printable
5353

5454
CanMsg(CanMsg const & other)
5555
{
56-
this->id = other.id;
57-
this->data_length = other.data_length;
58-
if (this->data_length && other.data)
59-
memcpy(this->data, other.data, this->data_length);
56+
id = other.id;
57+
data_length = other.data_length;
58+
if (data_length > 0)
59+
memcpy(data, other.data, data_length);
6060
}
6161

6262
virtual ~CanMsg() { }
@@ -65,10 +65,10 @@ class CanMsg : public Printable
6565
{
6666
if (this != &other)
6767
{
68-
this->id = other.id;
69-
this->data_length = other.data_length;
70-
if (this->data_length && other.data)
71-
memcpy(this->data, other.data, this->data_length);
68+
id = other.id;
69+
data_length = other.data_length;
70+
if (data_length > 0)
71+
memcpy(data, other.data, data_length);
7272
}
7373
return (*this);
7474
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.