RT-Thread-packages / umqtt

A light weight, powerful, customizable, easy-to-use and embeddable mqtt client for RT-Thread
Apache License 2.0
27 stars 10 forks source link

[fix] subscribe topic bug #13

Closed whj4674672 closed 3 years ago

whj4674672 commented 3 years ago
  1. 如果先订阅了 aaa ,在订阅 a 的时候,会提示已经订阅了,这里的判断是不合理的

    && (rt_strncmp(p_subtop->topicfilter, topic, rt_strlen(topic)) == 0)) 

    第二次订阅的时候 a 的长度是 1, 这里只会比较第一个字符,第一个字符的都是 a ,所以就会返回已经被订阅

  2. 函数的形参不一致,会导致编译器警告

whj4674672 commented 3 years ago

@Lawlieta

xiangxistu commented 3 years ago

Sure, we need fix it.