From a0a42f258fa55ada73ca676e796b075aad5262ba Mon Sep 17 00:00:00 2001 From: in2 Date: Sun, 30 Jan 2005 08:00:39 +0000 Subject: 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 --- innbbsd/receive_article.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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) { -- cgit v1.2.3