From 5d2f373c143ebdab7aa5157de33d779d8862200d Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Fri, 21 Nov 2014 16:03:22 +0100 Subject: [PATCH] mqtt plugin: Send only the acutally used part of the payload buffer. --- src/mqtt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mqtt.c b/src/mqtt.c index 3142bf3d..bfa2fdb9 100644 --- a/src/mqtt.c +++ b/src/mqtt.c @@ -287,7 +287,7 @@ static int mqtt_write (const data_set_t *ds, const value_list_t *vl, return (status); } - status = publish (conf, topic, payload, sizeof (payload)); + status = publish (conf, topic, payload, strlen (payload) + 1); if (status != 0) { ERROR ("mqtt plugin: publish failed: %s", mosquitto_strerror (status)); -- 2.11.0