Code

suppress quotes in perf data when not needed (some plugins need the space to keep...
authorKarl DeBisschop <kdebisschop@users.sourceforge.net>
Thu, 28 Aug 2003 03:21:32 +0000 (03:21 +0000)
committerKarl DeBisschop <kdebisschop@users.sourceforge.net>
Thu, 28 Aug 2003 03:21:32 +0000 (03:21 +0000)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@700 f882894a-f735-0410-b71e-b25c423dba1c

plugins/utils.c

index aad300686a0f1f6c173302fa7911a91591bf3065..5dbdb4de0c7f4beaa4233facade3beccfcf6e0a0 100644 (file)
@@ -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);