From afce03f27133a3e0e0a332ed84bb1f90e7936429 Mon Sep 17 00:00:00 2001
From: rswindell <>
Date: Wed, 13 Mar 2002 12:30:46 +0000
Subject: [PATCH] Fixed stripattr() for strings that end in a Ctrl-A char.

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

diff --git a/src/sbbs3/con_hi.cpp b/src/sbbs3/con_hi.cpp
index 9234fabb73..b51959f904 100644
--- a/src/sbbs3/con_hi.cpp
+++ b/src/sbbs3/con_hi.cpp
@@ -82,12 +82,15 @@ int sbbs_t::stripattr(char *strin)
 
 	e=strlen(strin);
 	for(a=c=d=0;c<e && d<sizeof(str)-1;c++) {
-		if(strin[c]==CTRL_A) {
+		if(strin[c]==CTRL_A && strin[c+1]!=0) {
 			a++;
 			if(!validattr(strin[c+1])) {
 				c++;
-				continue; } }
-		str[d++]=strin[c]; }
+				continue; 
+			} 
+		}
+		str[d++]=strin[c]; 
+	}
 	str[d]=0;
 	strcpy(strin,str);
 	return(a);
-- 
GitLab