summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mbbsd/io.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mbbsd/io.c b/mbbsd/io.c
index 69aa7bbc..d158575c 100644
--- a/mbbsd/io.c
+++ b/mbbsd/io.c
@@ -400,14 +400,14 @@ strip_ansi(char *buf, char *str, int mode)
while(isEscapeParam(*++p));
if( (mode == NO_RELOAD && isEscapeCommand(*p)) ||
(mode == ONLY_COLOR && *p == 'm' )){
- register int len = p - str + 1;
+ register int len = p - str;
if( buf ){
strncpy(buf, str, len);
buf += len;
}
count += len;
}
- str = p;
+ str = p - 1;
}
if( buf )
*buf = 0;