aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Uhlin <markus@nifty-networks.net>2024-04-07 17:18:45 +0200
committerMarkus Uhlin <markus@nifty-networks.net>2024-04-07 17:18:45 +0200
commit6128667ddddf01a6f4f7054bb0c723e89d710dde (patch)
tree01c433aa1b8f2e90c9e32375921d2001cb7a3df6
parent238330c495372efd7a2c488ca4fa4aa4fbd7ea32 (diff)
Revised on_channel()
-rw-r--r--FICS/talkproc.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/FICS/talkproc.c b/FICS/talkproc.c
index 9d5dac2..0a0a60f 100644
--- a/FICS/talkproc.c
+++ b/FICS/talkproc.c
@@ -904,11 +904,13 @@ PUBLIC int com_qtell(int p, param_list param)
return COM_OK;
}
-PUBLIC int on_channel(int ch, int p)
+PUBLIC int
+on_channel(int ch, int p)
{
- char tmp[10]; /* 9 digits ought to be enough :) */
+ char tmp[20];
- sprintf (tmp,"%d",ch);
- return in_list(p, L_CHANNEL,tmp ); /* since needs ch converted to a string keep
- hidden from view */
+ snprintf(tmp, sizeof tmp, "%d", ch);
+ return in_list(p, L_CHANNEL, tmp); // since needs 'ch' converted
+ // to a string keep hidden from
+ // view
}