Merge pull request #481 from bwibwi13/master

Correct maximum size of snprintf (use same size as the buffer ;)
This commit is contained in:
Nick O'Leary 2018-11-01 23:32:13 +00:00 committed by GitHub
commit 539838822c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -124,7 +124,7 @@ void loop() {
if (now - lastMsg > 2000) { if (now - lastMsg > 2000) {
lastMsg = now; lastMsg = now;
++value; ++value;
snprintf (msg, 75, "hello world #%ld", value); snprintf (msg, 50, "hello world #%ld", value);
Serial.print("Publish message: "); Serial.print("Publish message: ");
Serial.println(msg); Serial.println(msg);
client.publish("outTopic", msg); client.publish("outTopic", msg);