+ if (swap_chars(n_type_instance, type_instance, ' ', '_') == -1)
+ {
+ ERROR ("Unable to normalize datasource name");
+ return (-1);
+ }
+ }
+
+ if (plugin_instance != NULL && plugin_instance[0] != '\0')
+ {
+ if ((n_plugin_instance = malloc(strlen(plugin_instance)+1)) == NULL)
+ {
+ ERROR ("Unable to allocate memory for normalized plugin instance buffer");
+ return (-1);
+ }
+ if (swap_chars(n_plugin_instance, plugin_instance, ' ', '_') == -1)
+ {
+ ERROR ("Unable to normalize datasource name");
+ return (-1);
+ }