]> arthur.barton.de Git - ngircd-alex.git/commitdiff
Correctly check that a server has a valid hostname and port
authorAlexander Barton <alex@barton.de>
Wed, 10 Sep 2014 11:03:30 +0000 (13:03 +0200)
committerAlexander Barton <alex@barton.de>
Wed, 10 Sep 2014 11:03:30 +0000 (13:03 +0200)
David Binderman <dcb314@hotmail.com> reported the following compiler warning,
which is a real bug in ngIRCd, thanks!

conn.c:2077:55: warning: logical not is only applied to the left hand
                         side of comparison [-Wlogical-not-parentheses]

src/ngircd/conn.c

index 5c175dfd26e1bec492c2cb545296d6c37c58a55e..62561544866413f5abb1534da27caac1e2aa2218 100644 (file)
@@ -1904,7 +1904,7 @@ Check_Servers(void)
        for (i = 0; i < MAX_SERVERS; i++) {
                if (Conf_Server[i].conn_id != NONE)
                        continue;       /* Already establishing or connected */
-               if (!Conf_Server[i].host[0] || !Conf_Server[i].port > 0)
+               if (!Conf_Server[i].host[0] || Conf_Server[i].port <= 0)
                        continue;       /* No host and/or port configured */
                if (Conf_Server[i].flags & CONF_SFLAG_DISABLED)
                        continue;       /* Disabled configuration entry */