From 60acd5d5c995d677cc193e3f025fb886c288fb2a Mon Sep 17 00:00:00 2001
From: rswindell <>
Date: Fri, 3 Apr 2020 20:50:39 +0000
Subject: [PATCH] Remove some useless cruft that appears to be leftover from
 the time when help files were external to the executable (to conserve that
 precious 640KB of RAM!) Some more use of SAFEPRINTF for good mesaure.

---
 src/sbbs3/scfg/scfg.c | 17 ++---------------
 1 file changed, 2 insertions(+), 15 deletions(-)

diff --git a/src/sbbs3/scfg/scfg.c b/src/sbbs3/scfg/scfg.c
index e5cbfaf30d..2c433da3ef 100644
--- a/src/sbbs3/scfg/scfg.c
+++ b/src/sbbs3/scfg/scfg.c
@@ -431,26 +431,13 @@ int main(int argc, char **argv)
 		if((mopt[i]=(char *)malloc(64))==NULL)
 			allocfail(64);
 
-	if((p=getenv("SBBSEXEC"))!=NULL)
-		SAFECOPY(str,p);
-	else {
-		SAFECOPY(str,exepath);
-		p=strrchr(str,'/');
-		if(p==NULL)
-			p=strrchr(str,'\\');
-		if(p!=NULL)
-			*p=0;
-		else 
-	   		sprintf(str,"%s../exec",cfg.ctrl_dir);
-	}
-
-	sprintf(str,"Synchronet for %s v%s",PLATFORM_DESC,VERSION);
+	SAFEPRINTF2(str,"Synchronet for %s v%s",PLATFORM_DESC,VERSION);
 	if(uifc.scrn(str)) {
 		printf(" USCRN (len=%d) failed!\n",uifc.scrn_len+1);
 		bail(1);
 	}
 
-	sprintf(str,"%smain.cnf",cfg.ctrl_dir);
+	SAFEPRINTF(str,"%smain.cnf",cfg.ctrl_dir);
 	if(!fexist(str)) {
 		sprintf(errormsg,"Main configuration file (%s) missing!",str);
 		uifc.msg(errormsg);
-- 
GitLab