diff --git a/CPUMeter.c b/CPUMeter.c index f5716d93e..1451ed77a 100644 --- a/CPUMeter.c +++ b/CPUMeter.c @@ -55,6 +55,8 @@ static void CPUMeter_init(Meter* this) { // Custom uiName runtime logic to include the param (processor) static void CPUMeter_getUiName(const Meter* this, char* buffer, size_t length) { + assert(length > 0); + if (this->param > 0) xSnprintf(buffer, length, "%s %u", Meter_uiName(this), this->param); else diff --git a/DynamicMeter.c b/DynamicMeter.c index 513296023..605474f83 100644 --- a/DynamicMeter.c +++ b/DynamicMeter.c @@ -10,6 +10,7 @@ in the source distribution for its full text. #include "DynamicMeter.h" +#include #include #include #include @@ -97,6 +98,8 @@ static const char* DynamicMeter_getCaption(const Meter* this) { } static void DynamicMeter_getUiName(const Meter* this, char* name, size_t length) { + assert(length > 0); + const Settings* settings = this->host->settings; const DynamicMeter* meter = Hashtable_get(settings->dynamicMeters, this->param); if (meter) {