Update esp8266_tencent_firmware.c

if (!str) 
    {
        return -1;
    }
This commit is contained in:
David Lin 2020-08-10 18:31:45 +08:00 committed by GitHub
parent ad5f75d4a3
commit fbe69ca3f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -130,6 +130,10 @@ int esp8266_tencent_firmware_module_mqtt_state_get(mqtt_state_t *state)
}
str = strstr(echo.buffer, "+TCMQTTSTATE:");
if (!str)
{
return -1;
}
sscanf(str, "+TCMQTTSTATE:%d", &ret_state);
if (ret_state == 0) {
*state = MQTT_STATE_DISCONNECTED;