fix for extra float zero-terminator https://github.com/adafruit/Adafruit_MQTT_Library/issues/35
This commit is contained in:
parent
ad6ae59725
commit
bb240928e8
@ -768,7 +768,7 @@ bool Adafruit_MQTT_Publish::publish(int32_t i) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool Adafruit_MQTT_Publish::publish(double f, uint8_t precision) {
|
bool Adafruit_MQTT_Publish::publish(double f, uint8_t precision) {
|
||||||
char payload[40]; // Need to technically hold float max, 39 digits and minus sign.
|
char payload[41]; // Need to technically hold float max, 39 digits and minus sign.
|
||||||
dtostrf(f, 0, precision, payload);
|
dtostrf(f, 0, precision, payload);
|
||||||
return mqtt->publish(topic, payload, qos);
|
return mqtt->publish(topic, payload, qos);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user