Skip to content

Commit

Permalink
AP_BoardConfig: factor substring from allocation_error parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbarker authored and tridge committed Oct 18, 2021
1 parent d78f156 commit 5b2eced
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libraries/AP_BoardConfig/AP_BoardConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,9 @@ void AP_BoardConfig::allocation_error(const char *fmt, ...)
{
va_list arg_list;
va_start(arg_list, fmt);
throw_error("Allocation Error", fmt, arg_list);
char newfmt[64] {};
snprintf(newfmt, sizeof(newfmt), "Unable to allocate %s", fmt);
throw_error("Allocation Error", newfmt, arg_list);
va_end(arg_list);
}

Expand Down

0 comments on commit 5b2eced

Please sign in to comment.