summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 42e4d6c)
raw | patch | inline | side by side (parent: 42e4d6c)
author | Florian Forster <octo@collectd.org> | |
Tue, 10 Mar 2015 14:34:10 +0000 (15:34 +0100) | ||
committer | Florian Forster <octo@collectd.org> | |
Tue, 10 Mar 2015 14:34:10 +0000 (15:34 +0100) |
There were more cases in which "type" or "type_instance" were omitted.
Fixes: #945
Fixes: #945
src/write_tsdb.c | patch | blob | history |
diff --git a/src/write_tsdb.c b/src/write_tsdb.c
index bfac1a140d4020c065f7b473e5a19dc72013ad90..9008a67bf921b97a39525f16121d64916dcc212c 100644 (file)
--- a/src/write_tsdb.c
+++ b/src/write_tsdb.c
if (ds_name != NULL) {
if (vl->plugin_instance[0] == '\0') {
if (vl->type_instance[0] == '\0') {
- ssnprintf(ret, ret_len, "%s%s.%s.%s",
- prefix, vl->plugin, vl->type,
- ds_name);
+ ssnprintf(ret, ret_len, "%s%s.%s.%s", prefix, vl->plugin,
+ vl->type, ds_name);
} else {
- ssnprintf(ret, ret_len, "%s%s.%s.%s",
- prefix, vl->plugin, vl->type_instance,
- ds_name);
+ ssnprintf(ret, ret_len, "%s%s.%s.%s.%s", prefix, vl->plugin,
+ vl->type, vl->type_instance, ds_name);
+ }
+ } else { /* vl->plugin_instance != "" */
+ if (vl->type_instance[0] == '\0') {
+ ssnprintf(ret, ret_len, "%s%s.%s.%s.%s", prefix, vl->plugin,
+ vl->plugin_instance, vl->type, ds_name);
+ } else {
+ ssnprintf(ret, ret_len, "%s%s.%s.%s.%s.%s", prefix,
+ vl->plugin, vl->plugin_instance, vl->type,
+ vl->type_instance, ds_name);
}
- } else if (vl->type_instance[0] == '\0') {
- ssnprintf(ret, ret_len, "%s%s.%s.%s.%s",
- prefix, vl->plugin, vl->plugin_instance, vl->type,
- ds_name);
- } else {
- ssnprintf(ret, ret_len, "%s%s.%s.%s.%s.%s",
- prefix, vl->plugin, vl->plugin_instance, vl->type,
- vl->type_instance, ds_name);
}
- } else if (vl->plugin_instance[0] == '\0') {
- if (vl->type_instance[0] == '\0') {
- ssnprintf(ret, ret_len, "%s%s.%s",
- prefix, vl->plugin, vl->type);
- } else {
- ssnprintf(ret, ret_len, "%s%s.%s",
- prefix, vl->plugin, vl->type_instance);
+ } else { /* ds_name == NULL */
+ if (vl->plugin_instance[0] == '\0') {
+ if (vl->type_instance[0] == '\0') {
+ ssnprintf(ret, ret_len, "%s%s.%s", prefix, vl->plugin,
+ vl->type);
+ } else {
+ ssnprintf(ret, ret_len, "%s%s.%s.%s", prefix, vl->plugin,
+ vl->type_instance, vl->type);
+ }
+ } else { /* vl->plugin_instance != "" */
+ if (vl->type_instance[0] == '\0') {
+ ssnprintf(ret, ret_len, "%s%s.%s.%s", prefix, vl->plugin,
+ vl->plugin_instance, vl->type);
+ } else {
+ ssnprintf(ret, ret_len, "%s%s.%s.%s.%s", prefix, vl->plugin,
+ vl->plugin_instance, vl->type, vl->type_instance);
+ }
}
- } else if (vl->type_instance[0] == '\0') {
- ssnprintf(ret, ret_len, "%s%s.%s.%s",
- prefix, vl->plugin, vl->plugin_instance, vl->type);
- } else {
- ssnprintf(ret, ret_len, "%s%s.%s.%s.%s",
- prefix, vl->plugin, vl->plugin_instance, vl->type, vl->type_instance);
}
sfree(temp);