summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 98bfe15)
raw | patch | inline | side by side (parent: 98bfe15)
author | Denys Fedoryshchenko <denys@visp.net.lb> | |
Fri, 6 Jan 2017 01:36:16 +0000 (03:36 +0200) | ||
committer | Florian Forster <octo@collectd.org> | |
Tue, 17 Jan 2017 14:37:20 +0000 (15:37 +0100) |
src/mqtt.c | patch | blob | history |
diff --git a/src/mqtt.c b/src/mqtt.c
index 6b76af97b9d7818349720e0cbcb828957ac44ea5..8a24ccaa0132b6209d58dfcb3de33e728645a54b 100644 (file)
--- a/src/mqtt.c
+++ b/src/mqtt.c
value_list_t const *vl, mqtt_client_conf_t *conf) {
char name[MQTT_MAX_TOPIC_SIZE];
int status;
+ char *c;
if ((conf->topic_prefix == NULL) || (conf->topic_prefix[0] == 0))
return (FORMAT_VL(buf, buf_len, vl));
if ((status < 0) || (((size_t)status) >= buf_len))
return (ENOMEM);
+ while((c = strchr(buf, '#')) || (c = strchr(buf, '+'))) {
+ *c = '_';
+ }
+
return (0);
} /* int format_topic */