1
0
forked from bip/bip

Handle unlikely case: "CAPAB" present twice

If "CAPAB" element were present twice, a wrong element would be removed.
This commit is contained in:
Pierre-Louis Bonicoli 2014-09-16 02:50:04 +02:00
parent db27168c76
commit fda9fccb85

View File

@ -420,7 +420,7 @@ int irc_dispatch_server(bip_t *bip, struct link_server *server,
if (LINK(server)->ignore_server_capab &&
irc_line_elem_equals(line, 0, "005")) {
int i;
for (i = 1; i < irc_line_count(line); i++)
for (i = irc_line_count(line) - 1; i > 0; i--)
if (irc_line_elem_equals(line, i, "CAPAB"))
irc_line_drop(line, i);
}