From 22c3533745cb2dececefacb6bdafcca9868f24a5 Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Thu, 2 Jul 2015 18:02:45 +0200 Subject: [PATCH] Fix type of Adafruit_MQTT_Subscribe::lastread The lastread array stores the data bytes of the most recently read received packet. It was previously declared as an array of pointers to uint8_t, instead of an array of uint8_t, which obviously was not the intention. Because the examples explicitely cast to (char*) for printing (because Print::println(uint8_t[]) is not defined) and a pointer is at least as big as uint8_t and memcpy uses void*, this problem did not show up before. --- Adafruit_MQTT.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Adafruit_MQTT.h b/Adafruit_MQTT.h index a16c576..82e5bc1 100644 --- a/Adafruit_MQTT.h +++ b/Adafruit_MQTT.h @@ -202,7 +202,7 @@ class Adafruit_MQTT_Subscribe { const char *topic; uint8_t qos; - uint8_t * lastread[SUBSCRIPTIONDATALEN]; + uint8_t lastread[SUBSCRIPTIONDATALEN]; private: Adafruit_MQTT *mqtt; };