From 024abdb346a23474313d7a96834b0ed6855484b7 Mon Sep 17 00:00:00 2001
From: rswindell <>
Date: Tue, 27 Aug 2019 16:24:23 +0000
Subject: [PATCH] Eliminate call to inet_ntop() which is apparently not present
 in WinXP: The procedure entry point inet_ntop could not be located in dynamic
 link library ws2_32.dll

---
 src/sbbs3/main.cpp | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/sbbs3/main.cpp b/src/sbbs3/main.cpp
index b2a39ee9fe..882ae17d4e 100644
--- a/src/sbbs3/main.cpp
+++ b/src/sbbs3/main.cpp
@@ -1605,9 +1605,12 @@ static BYTE* telnet_interpret(sbbs_t* sbbs, BYTE* inbuf, int inlen,
 							,sbbs->telnet_mode&TELNET_MODE_GATE ? "passed-through" : "received"
 							,sbbs->telnet_location);
 					} else if(option==TELNET_TERM_LOCATION_NUMBER && sbbs->telnet_cmd[3] == 0) {
-						inet_ntop(AF_INET, sbbs->telnet_cmd + 4
-							,sbbs->telnet_location
-							,sizeof(sbbs->telnet_location));
+						SAFEPRINTF4(sbbs->telnet_location, "%u.%u.%u.%u"
+							,sbbs->telnet_cmd[4]
+							,sbbs->telnet_cmd[5]
+							,sbbs->telnet_cmd[6]
+							,sbbs->telnet_cmd[7]
+						);
 						lprintf(LOG_DEBUG,"Node %d %s telnet location number (IP address): %s"
 	                		,sbbs->cfg.node_num
 							,sbbs->telnet_mode&TELNET_MODE_GATE ? "passed-through" : "received"
-- 
GitLab