aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/irc.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/irc.c b/src/irc.c
index 4ea37a3..6f6b2f0 100644
--- a/src/irc.c
+++ b/src/irc.c
@@ -273,6 +273,17 @@ static void do_join(void) {
}
static void do_nick(void) {
+ /* Do not overwrite conf->nick with bogus data! sometimes when
+ we get disconnected, upon reconnect we get a partial message.
+ if it's a NICK, missing its destination argument, we end up
+ blowing away conf->nick, and subsequent reconnect attempts
+ fail with "USER: not enough parameters". This is purely
+ a band-aid; a proper solution involves rewriting parse_msg()
+ so it knows how many args each msg type needs, and refuses to
+ parse invalid ones. */
+ if(!msg_dest || !*msg_dest || *msg_dest == ' ')
+ return;
+
// ind_act_none();
if(streq_i(conf->nick, msg_src)) {
scr_print_active("You are ");