properly initialize variables

This commit is contained in:
Jens Mueller 2016-05-20 20:41:16 +02:00
parent ab1a0938b9
commit 9ccd463fb9

View File

@ -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;
} }