cppcheck reports this [and other less simple things].

Ross

Index: server_http.c
===================================================================
RCS file: /cvs/src/usr.sbin/httpd/server_http.c,v
retrieving revision 1.139
diff -u -p -r1.139 server_http.c
--- server_http.c       22 May 2020 07:18:17 -0000      1.139
+++ server_http.c       3 Aug 2020 05:01:26 -0000
@@ -1273,8 +1273,7 @@ server_response(struct httpd *httpd, str
                                    hostname, FNM_CASEFOLD);
                        }
                        if (ret == 0 &&
-                           (portval == -1 ||
-                           (portval != -1 && portval == srv_conf->port))) {
+                           (portval == -1 || portval == srv_conf->port)) {
                                /* Replace host configuration */
                                clt->clt_srv_conf = srv_conf;
                                srv_conf = NULL;

Reply via email to