Increase buffer size
Avoid buffer overflows with longer mqtt topics mqtDeviceTopic in wled.h is defined with a size of 33, so this should be set to 45 to accommodate the additional 12 characters - /temperature
This commit is contained in:
parent
d603a8a9be
commit
a69dcfc49d
@ -120,7 +120,7 @@ class UsermodTemperature : public Usermod {
|
|||||||
getTemperature();
|
getTemperature();
|
||||||
|
|
||||||
if (WLED_MQTT_CONNECTED) {
|
if (WLED_MQTT_CONNECTED) {
|
||||||
char subuf[38];
|
char subuf[45];
|
||||||
strcpy(subuf, mqttDeviceTopic);
|
strcpy(subuf, mqttDeviceTopic);
|
||||||
if (-100 <= temperature) {
|
if (-100 <= temperature) {
|
||||||
// dont publish super low temperature as the graph will get messed up
|
// dont publish super low temperature as the graph will get messed up
|
||||||
|
Loading…
Reference in New Issue
Block a user