From a38c7d16315a0d5953b87cfc8ab25e3fbfe60d94 Mon Sep 17 00:00:00 2001 From: Wouter Coekaerts Date: Mon, 3 Jan 2005 18:57:08 +0000 Subject: Fix multiple entries for local IP in /etc/hosts prevents connecting, patch by eridius (Bug 167) git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3697 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/irc/core/irc-servers.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/irc/core/irc-servers.c b/src/irc/core/irc-servers.c index a7d6729d..5d7953cd 100644 --- a/src/irc/core/irc-servers.c +++ b/src/irc/core/irc-servers.c @@ -142,8 +142,11 @@ static void server_init(IRC_SERVER_REC *server) } /* Replace ':' with '_' in our own hostname (the same IPv6 problem) */ + /* Replace '\n' and '\r' with '\0' in our own hostname to fix multiple PTR addreses */ for (ptr = hostname; *ptr != '\0'; ptr++) { if (*ptr == ':') *ptr = '_'; + if (*ptr == '\n') *ptr = '\0'; + if (*ptr == '\r') *ptr = '\0'; } /* don't allow hostname to begin with number or '+', '-'. those -- cgit v1.2.3