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

---
 src/sbbs3/getkey.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/sbbs3/getkey.cpp b/src/sbbs3/getkey.cpp
index dbd45f661e..d2ca882f3c 100644
--- a/src/sbbs3/getkey.cpp
+++ b/src/sbbs3/getkey.cpp
@@ -323,7 +323,7 @@ void sbbs_t::mnemonics(char *str)
 		attr(cfg.color[clr_mnelow]); }
 	l=0L;
 	while(str[l]) {
-		if(str[l]=='~' && str[l+1]) {
+		if(str[l]=='~' && str[l+1]!=0) {
 			if(!(useron.misc&ANSI))
 				outchar('(');
 			l++;
@@ -336,7 +336,8 @@ void sbbs_t::mnemonics(char *str)
 			if(!ctrl_a_codes)
 				attr(cfg.color[clr_mnelow]); }
 		else {
-			if(str[l]==CTRL_A) {        /* ctrl-a */
+			if(str[l]==CTRL_A           /* ctrl-a */
+				&& str[l+1]!=0)	{		/* valid */
 				ctrl_a(str[++l]);       /* skip the ctrl-a */
 				l++; }                  /* skip the attribute code */
 			else
-- 
GitLab