Browse Source

EKF: remove use of memset to initialise variable

When using a union of flags and integer value it is safer to initialise the value to 0 rather than memset the flags because the flags may not define all bits in the integer.
master
Paul Riseborough 8 years ago
parent
commit
2426f1dd3a
  1. 2
      EKF/estimator_interface.cpp

2
EKF/estimator_interface.cpp

@ -435,7 +435,7 @@ bool EstimatorInterface::initialise_interface(uint64_t timestamp) @@ -435,7 +435,7 @@ bool EstimatorInterface::initialise_interface(uint64_t timestamp)
_time_last_range = 0;
_time_last_airspeed = 0;
_time_last_optflow = 0;
memset(&_fault_status.flags, 0, sizeof(_fault_status.flags));
_fault_status.value = 0;
_time_last_ext_vision = 0;
return true;
}

Loading…
Cancel
Save