You've already forked Adafruit_MQTT_Library
							
							
				mirror of
				https://github.com/adafruit/Adafruit_MQTT_Library.git
				synced 2025-11-03 11:53:11 +03:00 
			
		
		
		
	properly initialize variables
This commit is contained in:
		@@ -94,6 +94,11 @@ Adafruit_MQTT::Adafruit_MQTT(const char *server,
 | 
				
			|||||||
    subscriptions[i] = 0;
 | 
					    subscriptions[i] = 0;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  will_topic = 0;
 | 
				
			||||||
 | 
					  will_payload = 0;
 | 
				
			||||||
 | 
					  will_qos = 0;
 | 
				
			||||||
 | 
					  will_retain = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  packet_id_counter = 0;
 | 
					  packet_id_counter = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -115,6 +120,11 @@ Adafruit_MQTT::Adafruit_MQTT(const __FlashStringHelper *server,
 | 
				
			|||||||
    subscriptions[i] = 0;
 | 
					    subscriptions[i] = 0;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  will_topic = 0;
 | 
				
			||||||
 | 
					  will_payload = 0;
 | 
				
			||||||
 | 
					  will_qos = 0;
 | 
				
			||||||
 | 
					  will_retain = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  packet_id_counter = 0;
 | 
					  packet_id_counter = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -134,6 +144,11 @@ Adafruit_MQTT::Adafruit_MQTT(const char *server,
 | 
				
			|||||||
    subscriptions[i] = 0;
 | 
					    subscriptions[i] = 0;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  will_topic = 0;
 | 
				
			||||||
 | 
					  will_payload = 0;
 | 
				
			||||||
 | 
					  will_qos = 0;
 | 
				
			||||||
 | 
					  will_retain = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  packet_id_counter = 0;
 | 
					  packet_id_counter = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -154,6 +169,11 @@ Adafruit_MQTT::Adafruit_MQTT(const __FlashStringHelper *server,
 | 
				
			|||||||
    subscriptions[i] = 0;
 | 
					    subscriptions[i] = 0;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  will_topic = 0;
 | 
				
			||||||
 | 
					  will_payload = 0;
 | 
				
			||||||
 | 
					  will_qos = 0;
 | 
				
			||||||
 | 
					  will_retain = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  packet_id_counter = 0;
 | 
					  packet_id_counter = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -753,6 +773,7 @@ Adafruit_MQTT_Subscribe::Adafruit_MQTT_Subscribe(Adafruit_MQTT *mqttserver,
 | 
				
			|||||||
  mqtt = mqttserver;
 | 
					  mqtt = mqttserver;
 | 
				
			||||||
  topic = feed;
 | 
					  topic = feed;
 | 
				
			||||||
  qos = q;
 | 
					  qos = q;
 | 
				
			||||||
 | 
					  datalen = 0;
 | 
				
			||||||
  callback = 0;
 | 
					  callback = 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -761,6 +782,7 @@ Adafruit_MQTT_Subscribe::Adafruit_MQTT_Subscribe(Adafruit_MQTT *mqttserver,
 | 
				
			|||||||
  mqtt = mqttserver;
 | 
					  mqtt = mqttserver;
 | 
				
			||||||
  topic = (const char *)feed;
 | 
					  topic = (const char *)feed;
 | 
				
			||||||
  qos = q;
 | 
					  qos = q;
 | 
				
			||||||
 | 
					  datalen = 0;
 | 
				
			||||||
  callback = 0;
 | 
					  callback = 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user