summaryrefslogtreecommitdiffstats
path: root/mbbsd/io.c
diff options
context:
space:
mode:
authorkcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-10-16 15:39:43 +0800
committerkcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-10-16 15:39:43 +0800
commitb4096259775ac622ffb8b3d8b700c625f9d1a750 (patch)
tree025d4c5a62ab3fbad910da2cf1f1f063d097bd02 /mbbsd/io.c
parentf4008618a3f76b120565d9b3eb9868e431ea078f (diff)
downloadpttbbs-b4096259775ac622ffb8b3d8b700c625f9d1a750.tar
pttbbs-b4096259775ac622ffb8b3d8b700c625f9d1a750.tar.gz
pttbbs-b4096259775ac622ffb8b3d8b700c625f9d1a750.tar.bz2
pttbbs-b4096259775ac622ffb8b3d8b700c625f9d1a750.tar.lz
pttbbs-b4096259775ac622ffb8b3d8b700c625f9d1a750.tar.xz
pttbbs-b4096259775ac622ffb8b3d8b700c625f9d1a750.tar.zst
pttbbs-b4096259775ac622ffb8b3d8b700c625f9d1a750.zip
strip IAC char in user's nick
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2254 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/io.c')
-rw-r--r--mbbsd/io.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/mbbsd/io.c b/mbbsd/io.c
index 4b324b8c..57d639c2 100644
--- a/mbbsd/io.c
+++ b/mbbsd/io.c
@@ -484,6 +484,19 @@ strip_ansi(char *buf, char *str, int mode)
* (buf) *buf = '\0'; return count; */
}
+void
+strip_iac(unsigned char *str, int maxlen)
+{
+ int i,len=0;
+
+ for(i=0;i<maxlen && str[i]; i++)
+ if(str[i]!=255) {
+ str[len++]=str[i];
+ }
+ if(len<maxlen)
+ str[len]='\0';
+}
+
int
oldgetdata(int line, int col, char *prompt, char *buf, int len, int echo)
{