Correct maximum size of snprintf (use same size as the buffer ;)
This commit is contained in:
		@@ -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);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user