Code

use single quotes per guideline, also quote when SPC or = are found
authorKarl DeBisschop <kdebisschop@users.sourceforge.net>
Thu, 28 Aug 2003 03:53:12 +0000 (03:53 +0000)
committerKarl DeBisschop <kdebisschop@users.sourceforge.net>
Thu, 28 Aug 2003 03:53:12 +0000 (03:53 +0000)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@702 f882894a-f735-0410-b71e-b25c423dba1c

plugins/utils.c

index 5dbdb4de0c7f4beaa4233facade3beccfcf6e0a0..ec2547392c0665c5acd1b1632ee84d9ef8837458 100644 (file)
@@ -521,8 +521,8 @@ char *perfdata (const char *label,
 {
        char *data = NULL;
 
-       if (index (label, '"'))
-               asprintf (&data, "\"%s\"=%ld%s;", label, val, uom);
+       if (strpbrk (label, "'= "))
+               asprintf (&data, "'%s'=%ld%s;", label, val, uom);
        else
                asprintf (&data, "%s=%ld%s;", label, val, uom);