From 6128667ddddf01a6f4f7054bb0c723e89d710dde Mon Sep 17 00:00:00 2001
From: Markus Uhlin <markus@nifty-networks.net>
Date: Sun, 7 Apr 2024 17:18:45 +0200
Subject: Revised on_channel()

---
 FICS/talkproc.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

(limited to 'FICS')

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
 }
-- 
cgit v1.2.3