From 59c97817e9cfe4a42894244638546afcf2e94285 Mon Sep 17 00:00:00 2001 From: Frank Date: Tue, 6 Feb 2024 16:59:37 +0100 Subject: [PATCH] fix malformed _total metrics --- src/web/web.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/web/web.h b/src/web/web.h index a166377f6..4c675c7db 100644 --- a/src/web/web.h +++ b/src/web/web.h @@ -786,7 +786,7 @@ class Web { char total[7]; if (metricDeclared) { // A declaration and value for channels have been delivered. So declare and deliver a _total metric - strncpy(total, "_total", 6); + strncpy(total, "_total", sizeof(total)); } if (!metricTotalDeclard) { snprintf(type, sizeof(type), "# TYPE %s%s%s%s %s\n",metricConstPrefix, iv->getFieldName(metricsChannelId, rec), promUnit.c_str(), total, promType.c_str());