From 15fb9d187d05aed7f80d643fe69ea3dd16cd0e22 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Wed, 1 Apr 2026 15:31:48 -0400 Subject: Tighten up irc.c a bit. Now 5499 bytes free. --- src/irc.c | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/src/irc.c b/src/irc.c index 63dc331..d6ed5de 100644 --- a/src/irc.c +++ b/src/irc.c @@ -152,7 +152,7 @@ static void print_ctcp(void) { } /* FIXME: this isn't very fast */ -static void do_ctcp(int is_notice) { +static void do_ctcp(char is_notice) { static char *p, *ctcp_type, *resp; resp = 0; @@ -330,25 +330,10 @@ static void do_kick(void) { print_reason(); } -static void do_mode(void) { - int i; - if(msg_src) - scr_print_active(msg_src); - else - scr_print_active("Server"); - scr_print_active(" sets mode: "); - for(i = 0; i < msg_argcount; i++) { - scr_print_active(msg_args[i]); - scr_putc_active(' '); - } - if(msg_text) scr_print_active(msg_text); - scr_eol_active(); -} - /* numerics call this with arg==1, since arg 0 is always our nick. other commands call with arg==0 to print everything. */ -static void do_catchall(int arg) { +static void do_catchall(char arg) { if(msg_src) { scr_print_active(msg_src); scr_putc_active(' '); @@ -368,6 +353,17 @@ static void do_catchall(int arg) { scr_eol_active(); } +static void do_mode(void) { + if(msg_src) { + scr_print_active(msg_src); + msg_src = 0; /* don't let do_catchall() print it again */ + } else { + scr_print_active("Server"); + } + scr_print_active(" sets mode:"); + do_catchall(0); +} + /* permutes last character (doesn't add one), so for "Bob" you get: Bo_, Bo1 through Bo9, BoA through BoZ Gives a total of 36 replacement nicks to try. -- cgit v1.2.3