fix for comparison of array 'tsMqttBrokerClientId' equal to a null pointer is

always false [-Werror,-Wtautological-pointer-compare]
  recnt_status.client_id = tsMqttBrokerClientId==NULL ||
This commit is contained in:
MysticBoy 2020-05-26 15:26:33 +08:00
parent f089b7c411
commit a99005e0e8
1 changed files with 1 additions and 1 deletions

View File

@ -68,7 +68,7 @@ int32_t mqttInitSystem() {
int _tpsize = strlen(topicPath) + strlen(TOPIC) + 1;
recnt_status.topic = calloc(1, _tpsize);
snprintf(recnt_status.topic, _tpsize-1, "/%s/" TOPIC, topicPath);
recnt_status.client_id = tsMqttBrokerClientId==NULL || strlen(tsMqttBrokerClientId)<3? tsMqttBrokerClientId:"taos_mqtt";
recnt_status.client_id = strlen(tsMqttBrokerClientId)<3? tsMqttBrokerClientId:"taos_mqtt";
taos_init();