File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments