aboutsummaryrefslogtreecommitdiff
path: root/src/irc.c
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2026-03-18 19:15:05 -0400
committerB. Watson <urchlay@slackware.uk>2026-03-18 19:15:05 -0400
commit8ae3acb491f07b4dc844dc7973efccdc6ca6a233 (patch)
tree3b7e42cd8f1c7bc3f3d2249579a8d34a0b0ccc8d /src/irc.c
parent858b68b23b3e7845a5a8b78fde832ccec5c4f3cd (diff)
downloadfujinet-chat-8ae3acb491f07b4dc844dc7973efccdc6ca6a233.tar.gz
Temporary fix for "USER: Not enough parameters".
Diffstat (limited to 'src/irc.c')
-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 ");