summaryrefslogtreecommitdiffstats
path: root/mbbsd
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-01-30 20:54:02 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-01-30 20:54:02 +0800
commitfcbf0439c1fcd12272854b0ed098bc1ecedb10a0 (patch)
treed60d733fe841c2938e9c38d6edfe3c03fbb17abd /mbbsd
parent5abb8fa043dfbff8cb1077e98f1ee9a2d20d17b3 (diff)
downloadpttbbs-fcbf0439c1fcd12272854b0ed098bc1ecedb10a0.tar
pttbbs-fcbf0439c1fcd12272854b0ed098bc1ecedb10a0.tar.gz
pttbbs-fcbf0439c1fcd12272854b0ed098bc1ecedb10a0.tar.bz2
pttbbs-fcbf0439c1fcd12272854b0ed098bc1ecedb10a0.tar.lz
pttbbs-fcbf0439c1fcd12272854b0ed098bc1ecedb10a0.tar.xz
pttbbs-fcbf0439c1fcd12272854b0ed098bc1ecedb10a0.tar.zst
pttbbs-fcbf0439c1fcd12272854b0ed098bc1ecedb10a0.zip
- fix over18 calculation
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3888 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r--mbbsd/mbbsd.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c
index cd7211e5..b350637b 100644
--- a/mbbsd/mbbsd.c
+++ b/mbbsd/mbbsd.c
@@ -1120,10 +1120,16 @@ user_login(void)
mysrand();
/* check if over18 */
- if( (ptime.tm_year - cuser.year) >= 18 ||
- (ptime.tm_year - cuser.year == 17 &&
- ((ptime.tm_mon+1) > cuser.month ||
- ((ptime.tm_mon+1) == cuser.month && ptime.tm_mday > cuser.day))) )
+ // ·Ó¹ê·³­pºâ
+ if( (ptime.tm_year - cuser.year) > 18)
+ over18 = 1;
+ else if (ptime.tm_year - cuser.year < 18)
+ over18 = 0;
+ else if ((ptime.tm_mon+1) > cuser.month)
+ over18 = 1;
+ else if ((ptime.tm_mon+1) < cuser.month)
+ over18 = 0;
+ else if (ptime.tm_mday >= cuser.day )
over18 = 1;
log_usies("ENTER", fromhost);