Correct maximum size of snprintf (use same size as the buffer ;)
This commit is contained in:
parent
54be6e87db
commit
c87c9a47b3
@ -124,7 +124,7 @@ void loop() {
|
||||
if (now - lastMsg > 2000) {
|
||||
lastMsg = now;
|
||||
++value;
|
||||
snprintf (msg, 75, "hello world #%ld", value);
|
||||
snprintf (msg, 50, "hello world #%ld", value);
|
||||
Serial.print("Publish message: ");
|
||||
Serial.println(msg);
|
||||
client.publish("outTopic", msg);
|
||||
|
Loading…
x
Reference in New Issue
Block a user