- if ((plugin_instance == NULL) || (strlen (plugin_instance) == 0))
- {
- if ((type_instance == NULL) || (strlen (type_instance) == 0))
- status = ssnprintf (ret, ret_len, "%s/%s/%s",
- hostname, plugin, type);
- else
- status = ssnprintf (ret, ret_len, "%s/%s/%s-%s",
- hostname, plugin, type,
- type_instance);
- }
- else
- {
- if ((type_instance == NULL) || (strlen (type_instance) == 0))
- status = ssnprintf (ret, ret_len, "%s/%s-%s/%s",
- hostname, plugin, plugin_instance,
- type);
- else
- status = ssnprintf (ret, ret_len, "%s/%s-%s/%s-%s",
- hostname, plugin, plugin_instance,
- type, type_instance);
- }
+ APPEND (hostname);
+ APPEND ("/");
+ APPEND (plugin);
+ if ((plugin_instance != NULL) && (plugin_instance[0] != 0))
+ {
+ APPEND ("-");
+ APPEND (plugin_instance);
+ }
+ APPEND ("/");
+ APPEND (type);
+ if ((type_instance != NULL) && (type_instance[0] != 0))
+ {
+ APPEND ("-");
+ APPEND (type_instance);
+ }
+ assert (buffer_size > 0);
+ buffer[0] = 0;