Tree wide: Don't set vl.host to hostname_g in plugin code.
[collectd.git] / src / openldap.c
index dd3226d..d5e58b1 100644 (file)
@@ -169,11 +169,7 @@ static void cldap_submit_value (const char *type, const char *type_instance, /*
        vl.values     = &value;
        vl.values_len = 1;
 
-       if ((st->host == NULL)
-                       || (strcmp ("", st->host) == 0)
-                       || (strcmp ("localhost", st->host) == 0))
-               sstrncpy (vl.host, hostname_g, sizeof (vl.host));
-       else
+       if ((st->host != NULL) && (strcmp ("localhost", st->host) != 0))
                sstrncpy (vl.host, st->host, sizeof (vl.host));
 
        sstrncpy (vl.plugin, "openldap", sizeof (vl.plugin));