1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-04 08:43:13 +02:00

irc: fix bug when changing server option "addresses" with less addresses (bug #37215)

This commit is contained in:
Simon Arlott
2012-09-03 10:26:45 +02:00
committed by Sebastien Helleu
parent 606be401cc
commit 055116f2b7
13 changed files with 36 additions and 35 deletions
+3 -4
View File
@@ -404,11 +404,10 @@ irc_server_set_index_current_address (struct t_irc_server *server, int index)
}
server->current_port = 0;
if (index < server->addresses_count)
if (server->addresses_count > 0)
{
index %= server->addresses_count;
server->index_current_address = index;
if (server->current_address)
free (server->current_address);
server->current_address = strdup (server->addresses_array[index]);
server->current_port = server->ports_array[index];
}
@@ -3593,7 +3592,7 @@ irc_server_connect (struct t_irc_server *server)
if (!server->current_address)
{
weechat_printf (server->buffer,
_("%s%s: unknown address server \"%s\", "
_("%s%s: unknown address for server \"%s\", "
"cannot connect"),
weechat_prefix ("error"), IRC_PLUGIN_NAME,
server->name);