TinyMqtt
TinyMqtt copied to clipboard
Fix wrong string compare in string indexer
fixed a wrong string compare in StringIndexer, leading to wrong behavior of the MQTT client and server. If you compare two strings with strncmp, you must also check if both have the same length, otherwise the check will get false positive results when a short string is the prefix of a longer string (e.g. "wind" <-> "window").
Could you please split the pull request so I can treat them individually. Yet I'm not sure to accept all the commits, but at least the string compare bug is ok for me.
Hello, back some months after on TinyMqtt
I'll fix the code accordingly to your commit db4b811fb6cf184855becda94b4141f337c81822.
I could not merge it because a unit test is missing. I'll write this unit test and fix this bug. Thanks for reporting
This PR has not been accepted as is, but I took the point and the bug is fixed. Thanks