X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=low-can-binding%2Futils%2Fopenxc-utils.cpp;h=c06beabb6ef39f2a9f5190a8bddc969038189394;hb=ea8e3ef5b673f0d2b7d096a6bd229e9edf5dec54;hp=e454121b6fb92d338bc789c9b86705b0b08fbd09;hpb=2daa033bd69b9ede497afa4355a5fdbb119895eb;p=apps%2Fagl-service-can-low-level.git diff --git a/low-can-binding/utils/openxc-utils.cpp b/low-can-binding/utils/openxc-utils.cpp index e454121b..c06beabb 100644 --- a/low-can-binding/utils/openxc-utils.cpp +++ b/low-can-binding/utils/openxc-utils.cpp @@ -34,6 +34,7 @@ const openxc_VehicleMessage build_VehicleMessage(active_diagnostic_request_t* request, const DiagnosticResponse& response, float parsed_value) { openxc_VehicleMessage message; + ::memset(&message, 0, sizeof(message)); application_t& app = application_t::instance(); message.has_type = true; @@ -98,6 +99,7 @@ const openxc_VehicleMessage build_VehicleMessage(active_diagnostic_request_t* re const openxc_VehicleMessage build_VehicleMessage(const openxc_SimpleMessage& message, uint64_t timestamp) { openxc_VehicleMessage v; + ::memset(&v, 0, sizeof(v)); v.has_type = true, v.type = openxc_VehicleMessage_Type::openxc_VehicleMessage_Type_SIMPLE; @@ -120,6 +122,7 @@ const openxc_VehicleMessage build_VehicleMessage(const openxc_SimpleMessage& mes const openxc_VehicleMessage build_VehicleMessage(const openxc_SimpleMessage& message) { openxc_VehicleMessage v; + ::memset(&v, 0, sizeof(v)); v.has_type = true, v.type = openxc_VehicleMessage_Type::openxc_VehicleMessage_Type_SIMPLE; @@ -141,7 +144,7 @@ openxc_VehicleMessage build_VehicleMessage() { openxc_VehicleMessage v; - ::memset(&v, 0, sizeof(openxc_VehicleMessage)); + ::memset(&v, 0, sizeof(v)); return v; }