summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorscw <scw@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-01-10 22:29:46 +0800
committerscw <scw@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-01-10 22:29:46 +0800
commita3e4ba9b6bbf132795a449c2656d7c1a5879d1cc (patch)
tree571460f6431e9fa14979791cd6a44204a7331809
parente293b3daae5393bdf6a90eee2a8d1d3f6bb663bd (diff)
downloadpttbbs-a3e4ba9b6bbf132795a449c2656d7c1a5879d1cc.tar
pttbbs-a3e4ba9b6bbf132795a449c2656d7c1a5879d1cc.tar.gz
pttbbs-a3e4ba9b6bbf132795a449c2656d7c1a5879d1cc.tar.bz2
pttbbs-a3e4ba9b6bbf132795a449c2656d7c1a5879d1cc.tar.lz
pttbbs-a3e4ba9b6bbf132795a449c2656d7c1a5879d1cc.tar.xz
pttbbs-a3e4ba9b6bbf132795a449c2656d7c1a5879d1cc.tar.zst
pttbbs-a3e4ba9b6bbf132795a449c2656d7c1a5879d1cc.zip
Wrong caculation of ansi escape sequence length.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1479 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-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;