[monitoring-plugins] Re-add separation semicolons for perfdata, which ...

RincewindsHat git at monitoring-plugins.org
Thu Oct 28 16:20:12 CEST 2021


 Module: monitoring-plugins
 Branch: master
 Commit: 73ed8109e5ba1c61f8ba435fd4324318d0751f18
 Author: RincewindsHat <12514511+RincewindsHat at users.noreply.github.com>
   Date: Tue Oct 26 20:47:28 2021 +0200
    URL: https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=73ed810

Re-add separation semicolons for perfdata, which I deleted

---

 plugins/utils.c | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)

diff --git a/plugins/utils.c b/plugins/utils.c
index ff0e55d..c0dce25 100644
--- a/plugins/utils.c
+++ b/plugins/utils.c
@@ -617,18 +617,22 @@ char *perfdata_uint64 (const char *label,
 	char *data = NULL;
 
 	if (strpbrk (label, "'= "))
-		xasprintf (&data, "'%s'=%ld%s;", label, val, uom);
+		xasprintf (&data, "'%s'=%ld%s", label, val, uom);
 	else
-		xasprintf (&data, "%s=%ld%s;", label, val, uom);
+		xasprintf (&data, "%s=%ld%s", label, val, uom);
+	xasprintf (&data, "%s;", data);
 
 	if (warnp)
-		xasprintf (&data, "%s%lu;", data, warn);
+		xasprintf (&data, "%s%lu", data, warn);
+	xasprintf (&data, "%s;", data);
 
 	if (critp)
-		xasprintf (&data, "%s%lu;", data, crit);
+		xasprintf (&data, "%s%lu", data, crit);
+	xasprintf (&data, "%s;", data);
 
 	if (minp)
 		xasprintf (&data, "%s%lu", data, minv);
+	xasprintf (&data, "%s;", data);
 
 	if (maxp)
 		xasprintf (&data, "%s;%lu", data, maxv);
@@ -652,18 +656,22 @@ char *perfdata_int64 (const char *label,
 	char *data = NULL;
 
 	if (strpbrk (label, "'= "))
-		xasprintf (&data, "'%s'=%ld%s;", label, val, uom);
+		xasprintf (&data, "'%s'=%ld%s", label, val, uom);
 	else
-		xasprintf (&data, "%s=%ld%s;", label, val, uom);
+		xasprintf (&data, "%s=%ld%s", label, val, uom);
+	xasprintf (&data, "%s;", data);
 
 	if (warnp)
-		xasprintf (&data, "%s%ld;", data, warn);
+		xasprintf (&data, "%s%ld", data, warn);
+	xasprintf (&data, "%s;", data);
 
 	if (critp)
-		xasprintf (&data, "%s%ld;", data, crit);
+		xasprintf (&data, "%s%ld", data, crit);
+	xasprintf (&data, "%s;", data);
 
 	if (minp)
 		xasprintf (&data, "%s%ld", data, minv);
+	xasprintf (&data, "%s;", data);
 
 	if (maxp)
 		xasprintf (&data, "%s;%ld", data, maxv);



More information about the Commits mailing list