From: Ruben Kerkhof Date: Tue, 13 Aug 2019 09:26:50 +0000 (+0200) Subject: common.c: remove always true comparison X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=2f8083194bee1ea05b189c2fd06090659986a54a;p=collectd.git common.c: remove always true comparison ntohs() returns an uint16_t, which is always less than 65535 --- diff --git a/src/utils/common/common.c b/src/utils/common/common.c index 7cfd3109..2d961d43 100644 --- a/src/utils/common/common.c +++ b/src/utils/common/common.c @@ -1456,13 +1456,13 @@ int service_name_to_port_number(const char *service_name) { service_number = (int)ntohs(sa->sin6_port); } - if ((service_number > 0) && (service_number <= 65535)) + if (service_number > 0) break; } freeaddrinfo(ai_list); - if ((service_number > 0) && (service_number <= 65535)) + if (service_number > 0) return service_number; return -1; } /* int service_name_to_port_number */