From b996b096b39fc9f14e65f0327b93173abb8f38ce Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Thu, 2 Jul 2015 13:28:38 +0200 Subject: [PATCH] Fix Adafruit_MQTT:subscribe() This method contained a loop that checked for an existing subscription, but it only printed a debug message if so. Now, it immediately returns true if the subscription is already registered. When this method succesfully adds a subscription, it was documented to return true, but the actual code did not return anything in this case, resulting in a compiler warning. In practice, on AVR, the value of the first argument would be returned, which likely evaluates as true, so it is likely it actually seemed to work fine. --- Adafruit_MQTT.cpp | 11 +++++------ Adafruit_MQTT.h | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Adafruit_MQTT.cpp b/Adafruit_MQTT.cpp index b0dbb16..557ee06 100644 --- a/Adafruit_MQTT.cpp +++ b/Adafruit_MQTT.cpp @@ -176,7 +176,7 @@ bool Adafruit_MQTT::subscribe(Adafruit_MQTT_Subscribe *sub) { for (i=0; i