From 9b5112f5472d33eaecaa3b5a5e3a1cf6b6cf708b Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Thu, 6 Aug 2020 13:43:57 +0100 Subject: [PATCH] Fix unsigned compared against 0. Coverity Scan 1431132. --- lib/net_mosq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/net_mosq.c b/lib/net_mosq.c index a66ad8fe..a2437caa 100644 --- a/lib/net_mosq.c +++ b/lib/net_mosq.c @@ -885,7 +885,7 @@ int net__socket_connect(struct mosquitto *mosq, const char *host, uint16_t port, mosq_sock_t sock = INVALID_SOCKET; int rc, rc2; - if(!mosq || !host || port < 0) return MOSQ_ERR_INVAL; + if(!mosq || !host) return MOSQ_ERR_INVAL; rc = net__try_connect(host, port, &sock, bind_address, blocking); if(rc > 0) return rc;