summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog1
-rw-r--r--src/irc/irc-recv.c5
-rw-r--r--weechat/ChangeLog1
-rw-r--r--weechat/src/irc/irc-recv.c5
4 files changed, 10 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index b83f4f19c..2f6c4f06f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,7 @@ WeeChat - Wee Enhanced Environment for Chat
ChangeLog - 2006-06-28
Version 0.2.0 (under dev!):
+ * fixed random crash when "MODE #chan -l" is received
* fixed bug in IRC parser (random crash with malformed IRC messages)
* fixed refresh bug (too many refresh) when terminal is resized
* case ignored for channel names in charset options (bug #16858)
diff --git a/src/irc/irc-recv.c b/src/irc/irc-recv.c
index a28478207..1a9b9ee04 100644
--- a/src/irc/irc-recv.c
+++ b/src/irc/irc-recv.c
@@ -865,7 +865,10 @@ void irc_get_channel_modes (t_irc_server *server, t_irc_channel *channel,
NULL);
CHANNEL_SET_MODE(channel, (set_flag == '+'),
CHANNEL_MODE_LIMIT);
- channel->limit = atoi (parm);
+ if (set_flag == '-')
+ channel->limit = 0;
+ if ((set_flag == '+') && parm)
+ channel->limit = atoi (parm);
/* look for next parameter */
if (parm && pos)
diff --git a/weechat/ChangeLog b/weechat/ChangeLog
index b83f4f19c..2f6c4f06f 100644
--- a/weechat/ChangeLog
+++ b/weechat/ChangeLog
@@ -4,6 +4,7 @@ WeeChat - Wee Enhanced Environment for Chat
ChangeLog - 2006-06-28
Version 0.2.0 (under dev!):
+ * fixed random crash when "MODE #chan -l" is received
* fixed bug in IRC parser (random crash with malformed IRC messages)
* fixed refresh bug (too many refresh) when terminal is resized
* case ignored for channel names in charset options (bug #16858)
diff --git a/weechat/src/irc/irc-recv.c b/weechat/src/irc/irc-recv.c
index a28478207..1a9b9ee04 100644
--- a/weechat/src/irc/irc-recv.c
+++ b/weechat/src/irc/irc-recv.c
@@ -865,7 +865,10 @@ void irc_get_channel_modes (t_irc_server *server, t_irc_channel *channel,
NULL);
CHANNEL_SET_MODE(channel, (set_flag == '+'),
CHANNEL_MODE_LIMIT);
- channel->limit = atoi (parm);
+ if (set_flag == '-')
+ channel->limit = 0;
+ if ((set_flag == '+') && parm)
+ channel->limit = atoi (parm);
/* look for next parameter */
if (parm && pos)