From ac3fbb933e9a34cba513de4aea695200d79440cd Mon Sep 17 00:00:00 2001
From: rswindell <>
Date: Wed, 2 May 2007 00:28:40 +0000
Subject: [PATCH] Set the current 'connection' (aka 'modem') description to the
 current DCE rate if a SexPOTS (dial-up) connection is detected.

---
 src/sbbs3/answer.cpp | 4 +++-
 src/sbbs3/main.cpp   | 6 +++---
 src/sbbs3/sbbs.h     | 2 +-
 3 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/sbbs3/answer.cpp b/src/sbbs3/answer.cpp
index 259875210b..265845ad91 100644
--- a/src/sbbs3/answer.cpp
+++ b/src/sbbs3/answer.cpp
@@ -349,8 +349,10 @@ bool sbbs_t::answer()
 	if(!online) 
 		return(false); 
 
-	if(stricmp(terminal,"sexpots")==0)	/* dial-up connection */
+	if(stricmp(terminal,"sexpots")==0) {	/* dial-up connection */
 		node_connection = (ushort)cur_rate;
+		SAFEPRINTF(connection,"%lu",cur_rate);
+	}
 
 	useron.misc&=~(ANSI|COLOR|RIP|WIP);
 	useron.misc|=autoterm;
diff --git a/src/sbbs3/main.cpp b/src/sbbs3/main.cpp
index 607251b25f..0faca6b9e0 100644
--- a/src/sbbs3/main.cpp
+++ b/src/sbbs3/main.cpp
@@ -2647,7 +2647,7 @@ sbbs_t::sbbs_t(ushort node_num, DWORD addr, char* name, SOCKET sd,
 	uselect_total = 0;
 	lbuflen = 0;
 	keybufbot=keybuftop=0;	/* initialize [unget]keybuf pointers */
-	connection="Telnet";
+	SAFECOPY(connection,"Telnet");
 	node_connection=NODE_CONNECTION_TELNET;
 
 	ZERO_VAR(telnet_local_option);
@@ -4998,7 +4998,7 @@ NO_SSH:
 		}
 
 		if(rlogin==true) {
-			new_node->connection="RLogin";
+			SAFECOPY(new_node->connection,"RLogin");
 			new_node->node_connection=NODE_CONNECTION_RLOGIN;
 			new_node->sys_status|=SS_RLOGIN;
 			new_node->telnet_mode|=TELNET_MODE_OFF; // RLogin does not use Telnet commands
@@ -5089,7 +5089,7 @@ NO_SSH:
 			_beginthread(passthru_input_thread, 0, new_node);
 
 NO_PASSTHRU:
-			new_node->connection="SSH";
+			SAFECOPY(new_node->connection,"SSH");
 			new_node->node_connection=NODE_CONNECTION_SSH;
 			new_node->sys_status|=SS_SSH;
 			new_node->telnet_mode|=TELNET_MODE_OFF; // SSH does not use Telnet commands
diff --git a/src/sbbs3/sbbs.h b/src/sbbs3/sbbs.h
index 2cbcda9693..345fed4749 100644
--- a/src/sbbs3/sbbs.h
+++ b/src/sbbs3/sbbs.h
@@ -281,7 +281,7 @@ public:
 	char    keybuf[KEY_BUFSIZE];    /* Keyboard input buffer */ 
 
 	ushort	node_connection;
-	char *	connection;		/* Connection Description */
+	char	connection[LEN_MODEM+1];	/* Connection Description */
 	ulong	cur_rate;		/* Current Connection (DCE) Rate */
 	ulong	cur_cps;		/* Current Average Transfer CPS */
 	ulong	dte_rate;		/* Current COM Port (DTE) Rate */
-- 
GitLab