diff --git a/libraries/AP_Torqeedo/AP_Torqeedo.cpp b/libraries/AP_Torqeedo/AP_Torqeedo.cpp index 0c92c7bd39..e03dec3ba0 100644 --- a/libraries/AP_Torqeedo/AP_Torqeedo.cpp +++ b/libraries/AP_Torqeedo/AP_Torqeedo.cpp @@ -208,6 +208,7 @@ bool AP_Torqeedo::healthy() } // run pre-arm check. returns false on failure and fills in failure_msg +// any failure_msg returned will not include a prefix bool AP_Torqeedo::pre_arm_checks(char *failure_msg, uint8_t failure_msg_len) { // exit immediately if not enabled @@ -215,13 +216,12 @@ bool AP_Torqeedo::pre_arm_checks(char *failure_msg, uint8_t failure_msg_len) return true; } - const char *failure_prefix = "Torqeedo:"; if (!_initialised) { - hal.util->snprintf(failure_msg, failure_msg_len, "%s not initialised", failure_prefix); + strncpy(failure_msg, "not initialised", failure_msg_len); return false; } if (!healthy()) { - hal.util->snprintf(failure_msg, failure_msg_len, "%s not healthy", failure_prefix); + strncpy(failure_msg, "not healthy", failure_msg_len); return false; } return true; diff --git a/libraries/AP_Torqeedo/AP_Torqeedo.h b/libraries/AP_Torqeedo/AP_Torqeedo.h index a4d6b18faf..b1d750e8b8 100644 --- a/libraries/AP_Torqeedo/AP_Torqeedo.h +++ b/libraries/AP_Torqeedo/AP_Torqeedo.h @@ -47,6 +47,7 @@ public: bool healthy(); // run pre-arm check. returns false on failure and fills in failure_msg + // any failure_msg returned will not include a prefix bool pre_arm_checks(char *failure_msg, uint8_t failure_msg_len); static const struct AP_Param::GroupInfo var_info[];