-
-
Notifications
You must be signed in to change notification settings - Fork 896
Fixed parsing of subscribed topics containing slashes. #633
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
Conversation
Git commit message(s) not good enough. I have mailed the details to the PR author. |
Core tests successful. |
Git commit message(s) look good! |
Core tests successful. |
Jenkins, build examples please. |
Congratulations! I found no problems building this pull request for any of the supported boards or examples. |
core/MyProtocolMySensors.cpp
Outdated
strncpy(topicTrimmed, &topic[strlen(MY_MQTT_SUBSCRIBE_TOPIC_PREFIX) + 1], topiclen); | ||
topicTrimmed[topiclen] = (char)0; | ||
|
||
for (str = strtok_r(topicTrimmed, "/", &p); str && i <= 5; |
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.
Do you really need to copy topic into the new buffer topicTrimmed?
I think you just could add to the topic pointer this:
for (str = strtok_r(topic + strlen(MY_MQTT_SUBSCRIBE_TOPIC_PREFIX), "/", &p);
Maybe you could test this in your environment?
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.
Great! That looks way more elegant. I'll try that on my environment today. Thanks.
Git commit message(s) look good! |
Core tests successful. |
Thanks @frizzy! |
No description provided.