diff options
author | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-01-30 16:00:39 +0800 |
---|---|---|
committer | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-01-30 16:00:39 +0800 |
commit | a0a42f258fa55ada73ca676e796b075aad5262ba (patch) | |
tree | 3b8c2a071794b4b0aece15f8382fcd4bad7809dd /innbbsd/receive_article.c | |
parent | 3f006f6561f3d31a7cff82294ece46df6014e08a (diff) | |
download | pttbbs-a0a42f258fa55ada73ca676e796b075aad5262ba.tar pttbbs-a0a42f258fa55ada73ca676e796b075aad5262ba.tar.gz pttbbs-a0a42f258fa55ada73ca676e796b075aad5262ba.tar.bz2 pttbbs-a0a42f258fa55ada73ca676e796b075aad5262ba.tar.lz pttbbs-a0a42f258fa55ada73ca676e796b075aad5262ba.tar.xz pttbbs-a0a42f258fa55ada73ca676e796b075aad5262ba.tar.zst pttbbs-a0a42f258fa55ada73ca676e796b075aad5262ba.zip |
remove bad characters in title. some bbs site like
bbs.wretch.COM will send these kind articles.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2444 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'innbbsd/receive_article.c')
-rw-r--r-- | innbbsd/receive_article.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/innbbsd/receive_article.c b/innbbsd/receive_article.c index dbd542ae..9960e7f8 100644 --- a/innbbsd/receive_article.c +++ b/innbbsd/receive_article.c @@ -760,7 +760,16 @@ post_article(homepath, userid, board, writebody, pathname, firstpath) sprintf(header.date, "%2d/%02d", ptime->tm_mon + 1, ptime->tm_mday); } #endif - + { + int i; + for( i = 0 ; header.title[i] != 0 && i < sizeof(header.title) ; ++i ) + if( header.title[i] == '\n' || + header.title[i] == '\r' || + header.title[i] == '\033' ){ + header.title[i] = 0; + break; + } + } append_record(index, &header, sizeof(header)); if ((bid = getbnum(board)) > 0) { |