Skip to content
Snippets Groups Projects
Commit f8f85f1e authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Fix CID 493283: Incorrect expression (NO_EFFECT)

    Comparing an array to null is not useful: "client->protocol == NULL",
    since the test will always evaluate as true.

or will always evaluate as *false* (the array won't ever be NULL). <shrug>
parent d787ad1a
No related branches found
No related tags found
1 merge request!455Update branch with changes from master
Pipeline #6401 passed
...@@ -808,7 +808,7 @@ int mqtt_user_login_fail(struct mqtt* mqtt, client_t* client, const char* userna ...@@ -808,7 +808,7 @@ int mqtt_user_login_fail(struct mqtt* mqtt, client_t* client, const char* userna
if(!mqtt->cfg->mqtt.enabled) if(!mqtt->cfg->mqtt.enabled)
return MQTT_SUCCESS; return MQTT_SUCCESS;
if(client->protocol == NULL || username == NULL) if(username == NULL)
return MQTT_FAILURE; return MQTT_FAILURE;
snprintf(topic, sizeof(topic), "login_fail/%s", client->protocol); snprintf(topic, sizeof(topic), "login_fail/%s", client->protocol);
strlwr(topic); strlwr(topic);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment