Skip to content
Permalink
Browse files

Fix pton in servmsg

Also, this commit was done at a bar. So. Yeah. Mmmmm.....
  • Loading branch information...
vanosg committed Sep 11, 2019
1 parent cce81b9 commit 9327a25d52b01c442adf53bea7dd7553b2f8cfc8
Showing with 13 additions and 17 deletions.
  1. +13 −17 src/mod/server.mod/servmsg.c
@@ -1529,8 +1529,8 @@ static void server_resolve_failure(int);
*/
static void connect_server(void)
{
char pass[121], botserver[UHOSTLEN], buf[16];
int servidx, v = 0;
char pass[121], botserver[UHOSTLEN], buf[16], s[1024];
int servidx, len = 0;
unsigned int botserverport = 0;

lastpingcheck = 0;
@@ -1570,28 +1570,24 @@ static void connect_server(void)
do_tcl("connect-server", connectserver);
check_tcl_event("connect-server");
next_server(&curserv, botserver, &botserverport, pass);

#ifdef IPV6
if (inet_pton(AF_INET6, botserver, buf)) {
v = 6; /* Because ipv6! Get it? */
}
len += egg_snprintf(s, sizeof s, "%s [%s]", IRC_SERVERTRY, botserver);
} else {
#endif
if (v) {
#ifdef TLS
putlog(LOG_SERV, "*", "%s [%s]:%s%d", IRC_SERVERTRY, botserver,
use_ssl ? "+" : "", botserverport);
#else
putlog(LOG_SERV, "*", "%s [%s]:%d", IRC_SERVERTRY, botserver,
botserverport);
len += egg_snprintf(s, sizeof s, "%s %s", IRC_SERVERTRY, botserver);
#ifdef IPV6
}
#endif
} else {

#ifdef TLS
putlog(LOG_SERV, "*", "%s %s:%s%d", IRC_SERVERTRY, botserver,
use_ssl ? "+" : "", botserverport);
len += egg_snprintf(s + len, (sizeof s) - len, ":%s%d",
use_ssl ? "+" : "", botserverport);
#else
putlog(LOG_SERV, "*", "%s %s:%d", IRC_SERVERTRY, botserver,
botserverport);
len += egg_snprintf(s + len, (sizeof s) - len, ":%d", botserverport);
#endif
}
putlog(LOG_SERV, "*", "%s", s);
dcc[servidx].port = botserverport;
strcpy(dcc[servidx].nick, "(server)");
strlcpy(dcc[servidx].host, botserver, UHOSTLEN);

0 comments on commit 9327a25

Please sign in to comment.
You can’t perform that action at this time.