Merge pull request #40 from jmue/fix/indeterminate_variables

properly initialize variables
This commit is contained in:
Limor "Ladyada" Fried 2016-05-20 14:47:42 -04:00
commit a66f64da88

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