From 781f9a14453d9c08c9d50959915e83dd038bcf1a20b0684bec0e92fbdb124e14 Mon Sep 17 00:00:00 2001 From: localhorst Date: Sat, 10 Jan 2026 11:02:31 +0100 Subject: [PATCH] ncorrect memset with strlen --- main/metrics.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main/metrics.c b/main/metrics.c index f87763a..2aabf7a 100644 --- a/main/metrics.c +++ b/main/metrics.c @@ -307,7 +307,7 @@ void taskMetrics(void *pvParameters) aMetrics[u16MetricCounter].i64MetricValue = ap.rssi; u16MetricCounter++; - configASSERT(u16MetricCounter > METRIC_MAX_COUNT); + configASSERT(!(u16MetricCounter > METRIC_MAX_COUNT)); vSetMetrics(aMetrics, u16MetricCounter); } } @@ -317,7 +317,7 @@ void vSetMetrics(sMetric *paMetrics, uint16_t u16Size) if (xSemaphoreTakeRecursive(xMutexAccessMetricResponse, pdMS_TO_TICKS(5000)) == pdTRUE) { - memset(caHtmlResponse, 0U, strlen(caHtmlResponse)); + memset(caHtmlResponse, 0U, HTML_RESPONSE_SIZE); for (uint16_t u16Index = 0U; u16Index < u16Size; u16Index++) { char caValueBuffer[64];