- wg_copy_escape_part (n_hostname, hostname,
- sizeof (n_hostname), escape_char);
- wg_copy_escape_part (n_plugin, plugin,
- sizeof (n_plugin), escape_char);
- wg_copy_escape_part (n_plugin_instance, plugin_instance,
- sizeof (n_plugin_instance), escape_char);
- wg_copy_escape_part (n_type, type,
- sizeof (n_type), escape_char);
- wg_copy_escape_part (n_type_instance, type_instance,
- sizeof (n_type_instance), escape_char);
-
- if (n_plugin_instance[0] == '\0')
- {
- if (n_type_instance[0] == '\0')
- {
- status = ssnprintf (ret, ret_len, "%s%s%s.%s.%s.%s",
- prefix, n_hostname, postfix, n_plugin, n_type, ds_name);
- }
- else
- {
- status = ssnprintf (ret, ret_len, "%s%s%s.%s.%s-%s.%s",
- prefix, n_hostname, postfix, n_plugin, n_type,
- n_type_instance, ds_name);
- }
- }
+ wg_copy_escape_part (n_host, vl->host,
+ sizeof (n_host), cb->escape_char);
+ wg_copy_escape_part (n_plugin, vl->plugin,
+ sizeof (n_plugin), cb->escape_char);
+ wg_copy_escape_part (n_plugin_instance, vl->plugin_instance,
+ sizeof (n_plugin_instance), cb->escape_char);
+ wg_copy_escape_part (n_type, vl->type,
+ sizeof (n_type), cb->escape_char);
+ wg_copy_escape_part (n_type_instance, vl->type_instance,
+ sizeof (n_type_instance), cb->escape_char);
+
+ if (n_plugin_instance[0] != '\0')
+ ssnprintf (tmp_plugin, sizeof (tmp_plugin), "%s%c%s",
+ n_plugin,
+ cb->separate_instances ? '.' : '-',
+ n_plugin_instance);