From f8f85f1e4ae337d9fbbc0caa7e1d292a6de9a44c Mon Sep 17 00:00:00 2001 From: "Rob Swindell (on Windows 11)" <rob@synchro.net> Date: Sat, 4 May 2024 16:03:31 -0700 Subject: [PATCH] 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> --- src/sbbs3/mqtt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sbbs3/mqtt.c b/src/sbbs3/mqtt.c index 7312db7435..1c1adf35d7 100644 --- a/src/sbbs3/mqtt.c +++ b/src/sbbs3/mqtt.c @@ -808,7 +808,7 @@ int mqtt_user_login_fail(struct mqtt* mqtt, client_t* client, const char* userna if(!mqtt->cfg->mqtt.enabled) return MQTT_SUCCESS; - if(client->protocol == NULL || username == NULL) + if(username == NULL) return MQTT_FAILURE; snprintf(topic, sizeof(topic), "login_fail/%s", client->protocol); strlwr(topic); -- GitLab