diff options
author | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-03-12 11:24:46 +0800 |
---|---|---|
committer | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-03-12 11:24:46 +0800 |
commit | bf0ff170400889443fd3e3fffc6b1ae2b1738d68 (patch) | |
tree | 33b84a25b6b5809e2c526515de2b516f634ecb4d /mbbsd/register.c | |
parent | 4d791013a709c9269c4e4872fd9d379168d0f47a (diff) | |
download | pttbbs-bf0ff170400889443fd3e3fffc6b1ae2b1738d68.tar pttbbs-bf0ff170400889443fd3e3fffc6b1ae2b1738d68.tar.gz pttbbs-bf0ff170400889443fd3e3fffc6b1ae2b1738d68.tar.bz2 pttbbs-bf0ff170400889443fd3e3fffc6b1ae2b1738d68.tar.lz pttbbs-bf0ff170400889443fd3e3fffc6b1ae2b1738d68.tar.xz pttbbs-bf0ff170400889443fd3e3fffc6b1ae2b1738d68.tar.zst pttbbs-bf0ff170400889443fd3e3fffc6b1ae2b1738d68.zip |
move global variable xuser into local, save 512 bytes.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2596 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/register.c')
-rw-r--r-- | mbbsd/register.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/mbbsd/register.c b/mbbsd/register.c index f2413f39..7786c26e 100644 --- a/mbbsd/register.c +++ b/mbbsd/register.c @@ -208,6 +208,9 @@ new_register(void) more("etc/register", NA); try = 0; while (1) { + userec_t xuser; + int minute; + if (++try >= 6) { vmsg("您嘗試錯誤的輸入太多,請下次再來吧"); exit(1); @@ -218,12 +221,12 @@ new_register(void) if (bad_user_id(passbuf)) outs("無法接受這個代號,請使用英文字母,並且不要包含空格\n"); - else if ((id = getuser(passbuf)) && - (id = check_and_expire_account(id, &xuser)) >= 0) { - if (id == 999999) + else if ((id = getuser(passbuf, &xuser)) && + (minute = check_and_expire_account(id, &xuser)) >= 0) { + if (minute == 999999) // XXX magic number outs("此代號已經有人使用 是不死之身"); else { - prints("此代號已經有人使用 還有%d天才過期 \n", id / (60 * 24)); + prints("此代號已經有人使用 還有%d天才過期 \n", minute / (60 * 24)); } } else break; |