From 147904d69739fa27a6f181e9e7493ea4462b470c Mon Sep 17 00:00:00 2001 From: in2 Date: Thu, 22 Apr 2004 15:32:10 +0000 Subject: use strncasecmp instead strcasestr for checking if userid has fuck or shit git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1807 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/register.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'mbbsd') diff --git a/mbbsd/register.c b/mbbsd/register.c index 7e76e897..9e6c60b3 100644 --- a/mbbsd/register.c +++ b/mbbsd/register.c @@ -64,8 +64,10 @@ bad_user_id(char *userid) if (strcasecmp(userid, str_new) == 0) return 1; - if (strcasestr(userid, "fuck") != NULL || - strcasestr(userid, "shit") != NULL ) + /* in2: 原本是用strcasestr, + 不過有些人中間剛剛好出現這個字應該還算合理吧? */ + if( strncasecmp(userid, "fuck", 4) == 0 || + strncasecmp(userid, "shit", 4) == 0 ) return 1; /* -- cgit v1.2.3