diff options
author | scw <scw@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2003-12-24 14:58:25 +0800 |
---|---|---|
committer | scw <scw@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2003-12-24 14:58:25 +0800 |
commit | 36b8776e3788b80fa07f4e43288bc60ab1d69b13 (patch) | |
tree | 1f4ec895fe0f0f6147a0dca582a2def8b96b8b75 /mbbsd/vote.c | |
parent | a2bd0bb8576c56e3221ecfd600700821076cf914 (diff) | |
download | pttbbs-36b8776e3788b80fa07f4e43288bc60ab1d69b13.tar pttbbs-36b8776e3788b80fa07f4e43288bc60ab1d69b13.tar.gz pttbbs-36b8776e3788b80fa07f4e43288bc60ab1d69b13.tar.bz2 pttbbs-36b8776e3788b80fa07f4e43288bc60ab1d69b13.tar.lz pttbbs-36b8776e3788b80fa07f4e43288bc60ab1d69b13.tar.xz pttbbs-36b8776e3788b80fa07f4e43288bc60ab1d69b13.tar.zst pttbbs-36b8776e3788b80fa07f4e43288bc60ab1d69b13.zip |
Rewrite strip_ansi() (also move from vote.c to io.c).
Using STRIP_ALL instead of 0 when calling strip_ansi.
Fix some buffer overflow problem.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1428 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/vote.c')
-rw-r--r-- | mbbsd/vote.c | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/mbbsd/vote.c b/mbbsd/vote.c index 8213ea69..16455e7f 100644 --- a/mbbsd/vote.c +++ b/mbbsd/vote.c @@ -19,40 +19,6 @@ static char STR_new_comments[] = "comments0\0"; /* 投票者的建議 */ static char STR_new_limited[] = "limited0\0"; /* 私人投票 */ static char STR_new_title[] = "vtitle0\0"; -int -strip_ansi(char *buf, char *str, int mode) -{ - register int ansi, count = 0; - - for (ansi = 0; *str /* && *str != '\n' */ ; str++) { - if (*str == 27) { - if (mode) { - if (buf) - *buf++ = *str; - count++; - } - ansi = 1; - } else if (ansi && strchr("[;1234567890mfHABCDnsuJKc=n", *str)) { - if ((mode == NO_RELOAD && !strchr("c=n", *str)) || - (mode == ONLY_COLOR && strchr("[;1234567890m", *str))) { - if (buf) - *buf++ = *str; - count++; - } - if (strchr("mHn ", *str)) - ansi = 0; - } else { - ansi = 0; - if (buf) - *buf++ = *str; - count++; - } - } - if (buf) - *buf = '\0'; - return count; -} - void b_suckinfile(FILE * fp, char *fname) { |