diff options
-rw-r--r-- | mbbsd/mbbsd.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c index 979d76dc..754e5388 100644 --- a/mbbsd/mbbsd.c +++ b/mbbsd/mbbsd.c @@ -1066,23 +1066,23 @@ inline static void foreign_warning(void){ static void user_login(void) { - struct tm *ptime, *lasttime; + struct tm ptime, lasttime; int nowusers, ifbirth = 0, i; /* NOTE! �b setup_utmp ���e, �����Ӧ����� blocking/slow function, * �_�h�i�Ǿ� race condition �F�� multi-login */ /* get local time */ - ptime = localtime4(&now); + ptime = *localtime4(&now); /* ��l��: random number �W�[user��ɶ����t�� */ 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))) ) + 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))) ) over18 = 1; log_usies("ENTER", fromhost); @@ -1109,11 +1109,11 @@ user_login(void) /* ��l�� uinfo�Bflag�Bmode */ setup_utmp(LOGIN); enter_uflag = cuser.uflag; - lasttime = localtime4(&cuser.lastlogin); + lasttime = *localtime4(&cuser.lastlogin); /* show welcome_login */ - if( (ifbirth = (ptime->tm_mday == cuser.day && - ptime->tm_mon + 1 == cuser.month)) ){ + if( (ifbirth = (ptime.tm_mday == cuser.day && + ptime.tm_mon + 1 == cuser.month)) ){ char buf[PATHLEN]; snprintf(buf, sizeof(buf), "etc/Welcome_birth.%d", getHoroscope(cuser.month, cuser.day)); more(buf, NA); @@ -1158,7 +1158,7 @@ user_login(void) welcome_msg(); if( ifbirth ){ - birthday_make_a_wish(ptime, lasttime); + birthday_make_a_wish(&ptime, &lasttime); if( getans("�O�_�n��ܡu�جP�v��ϥΪ̦W��W�H(y/N)") == 'y' ) currutmp->birth = 1; } @@ -1181,7 +1181,7 @@ user_login(void) check_mailbox_quota(); } - if(ptime->tm_yday != lasttime->tm_yday) + if(ptime.tm_yday!=lasttime.tm_yday) STATINC(STAT_TODAYLOGIN_MAX); if (!PERM_HIDE(currutmp)) { @@ -1202,7 +1202,7 @@ user_login(void) #endif /* login time update */ - if(ptime->tm_yday != lasttime->tm_yday) + if(ptime.tm_yday!=lasttime.tm_yday) STATINC(STAT_TODAYLOGIN_MIN); @@ -1243,12 +1243,11 @@ do_aloha(const char *hello) setuserfile(genbuf, "aloha"); if ((fp = fopen(genbuf, "r"))) { - snprintf(genbuf, sizeof(genbuf), hello); while (fgets(userid, 80, fp)) { userinfo_t *uentp; if ((uentp = (userinfo_t *) search_ulist_userid(userid)) && isvisible(uentp, currutmp)) { - my_write(uentp->pid, genbuf, uentp->userid, WATERBALL_ALOHA, uentp); + my_write(uentp->pid, hello, uentp->userid, WATERBALL_ALOHA, uentp); } } fclose(fp); |