From: Florian Forster Date: Fri, 21 Nov 2014 15:03:22 +0000 (+0100) Subject: mqtt plugin: Send only the acutally used part of the payload buffer. X-Git-Tag: collectd-5.6.0~637^2~9 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=5d2f373c143ebdab7aa5157de33d779d8862200d;p=collectd.git mqtt plugin: Send only the acutally used part of the payload buffer. --- 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));