From c045c474a9af21d9edaeba65d694f21375ca44cc Mon Sep 17 00:00:00 2001
From: Karl DeBisschop <kdebisschop@users.sourceforge.net>
Date: Thu, 28 Aug 2003 03:21:32 +0000
Subject: suppress quotes in perf data when not needed (some plugins need the
 space to keep below line length limit

git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@700 f882894a-f735-0410-b71e-b25c423dba1c

diff --git a/plugins/utils.c b/plugins/utils.c
index aad3006..5dbdb4d 100644
--- a/plugins/utils.c
+++ b/plugins/utils.c
@@ -521,7 +521,10 @@ char *perfdata (const char *label,
 {
 	char *data = NULL;
 
-	asprintf (&data, "\"%s\"=%ld%s;", label, val, uom);
+	if (index (label, '"'))
+		asprintf (&data, "\"%s\"=%ld%s;", label, val, uom);
+	else
+		asprintf (&data, "%s=%ld%s;", label, val, uom);
 
 	if (warnp)
 		asprintf (&data, "%s%ld;", data, warn);
-- 
cgit v0.10-9-g596f

