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:
committed by
Sebastien Helleu
parent
606be401cc
commit
055116f2b7
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user