-
Notifications
You must be signed in to change notification settings - Fork 293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Removed all occurences of pgm_read_byte #172
base: master
Are you sure you want to change the base?
Conversation
Dear developers at Adafruit, If you're having problems reproducing the problem (although it should be clear that Thanks, |
@ladyada Is this OK to merge, do we still want to support |
yeah can remove, its not a PROGMEM, its const char |
Adafruit_MQTT.cpp
Outdated
@@ -578,7 +578,7 @@ uint8_t Adafruit_MQTT::connectPacket(uint8_t *packet) { | |||
p[0] = MQTT_CONN_CLEANSESSION; | |||
|
|||
// set the will flags if needed | |||
if (will_topic && pgm_read_byte(will_topic) != 0) { | |||
if (will_topic && will_topic[0] != '\0') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eutill Why are you comparing \0
(null char.) here instead of 0
(int) from the previous will set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because I didn't know that comparing to 0
(int) was equivalent for checking for null-termination.
Please feel free to commit on this.
@brentru I changed the null termination checks back to the usual form. You can go ahead now. |
Hello Adafruit,
after some deep diving in this library's source code that you are so kind to provide and which, by the way, does an awesome job together with your FONA module and Adafruit IO, I found an remnant of the times where user authentication data were still saved in PROGMEM. Unfortunately, these 7 occurences of pgm_read_byte that are still there have gone unnoticed until today. They only cause problems if one tries to comment out
#define MQTT_DEBUG
. I won't go into detail but I think that these small adjustments will help some people as this will potentially solve issue #54.I hope that this library is still being maintained.
Thank you!
eutill