AP_Motors: use NEW_NOTHROW for new(std::nothrow)

This commit is contained in:
Andrew Tridgell 2024-05-27 11:24:13 +10:00
parent 3912c6a5e0
commit e5a63eaad0
1 changed files with 1 additions and 1 deletions

View File

@ -286,7 +286,7 @@ void AP_Motors::set_frame_string(const char * str) {
return; return;
} }
const size_t len = strlen(str)+1; const size_t len = strlen(str)+1;
custom_frame_string = new char[len]; custom_frame_string = NEW_NOTHROW char[len];
if (custom_frame_string != nullptr) { if (custom_frame_string != nullptr) {
strncpy(custom_frame_string, str, len); strncpy(custom_frame_string, str, len);
} }