diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2008-01-30 20:54:02 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2008-01-30 20:54:02 +0800 |
commit | fcbf0439c1fcd12272854b0ed098bc1ecedb10a0 (patch) | |
tree | d60d733fe841c2938e9c38d6edfe3c03fbb17abd /mbbsd | |
parent | 5abb8fa043dfbff8cb1077e98f1ee9a2d20d17b3 (diff) | |
download | pttbbs-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.c | 14 |
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); |