From a3e4ba9b6bbf132795a449c2656d7c1a5879d1cc Mon Sep 17 00:00:00 2001 From: scw Date: Sat, 10 Jan 2004 14:29:46 +0000 Subject: Wrong caculation of ansi escape sequence length. git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1479 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/io.c | 4 ++-- 1 file 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; -- cgit v1.2.3