summaryrefslogtreecommitdiffstats
path: root/mbbsd/admin.c
diff options
context:
space:
mode:
authorptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-05-13 11:20:04 +0800
committerptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-05-13 11:20:04 +0800
commit6a428fb60d8ec6092d428b2e0f869a31f4890dc7 (patch)
treea0671ea2dc0168a9cb5625f867d553f6d0441efc /mbbsd/admin.c
parent438c456b95eec0e5ac662ca3cf2386dff2c44bc7 (diff)
downloadpttbbs-6a428fb60d8ec6092d428b2e0f869a31f4890dc7.tar
pttbbs-6a428fb60d8ec6092d428b2e0f869a31f4890dc7.tar.gz
pttbbs-6a428fb60d8ec6092d428b2e0f869a31f4890dc7.tar.bz2
pttbbs-6a428fb60d8ec6092d428b2e0f869a31f4890dc7.tar.lz
pttbbs-6a428fb60d8ec6092d428b2e0f869a31f4890dc7.tar.xz
pttbbs-6a428fb60d8ec6092d428b2e0f869a31f4890dc7.tar.zst
pttbbs-6a428fb60d8ec6092d428b2e0f869a31f4890dc7.zip
replace time(NULL) by now
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@163 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/admin.c')
-rw-r--r--mbbsd/admin.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/mbbsd/admin.c b/mbbsd/admin.c
index 66043aa4..f97a3603 100644
--- a/mbbsd/admin.c
+++ b/mbbsd/admin.c
@@ -1,4 +1,4 @@
-/* $Id: admin.c,v 1.10 2002/05/10 19:34:51 in2 Exp $ */
+/* $Id: admin.c,v 1.11 2002/05/13 03:20:04 ptt Exp $ */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -19,7 +19,7 @@ extern char *msg_uid;
extern userec_t xuser;
extern char *err_uid;
extern boardheader_t *bcache;
-
+extern time_t now;
/* 使用者管理 */
int m_user() {
userec_t muser;
@@ -891,8 +891,7 @@ int scan_register_form(char *regfile, int automode, int neednum) {
if((fout = fopen(logfile, "a"))) {
for(n = 0; field[n]; n++)
fprintf(fout, "%s: %s\n", field[n], fdata[n]);
- n = time(NULL);
- fprintf(fout, "Date: %s\n", Cdate((time_t *) & n));
+ fprintf(fout, "Date: %s\n", Cdate(& now));
fprintf(fout, "Rejected: %s [%s]\n----\n",
uid, buf);
fclose(fout);
@@ -926,8 +925,7 @@ int scan_register_form(char *regfile, int automode, int neednum) {
if((fout = fopen(logfile, "a"))) {
for(n = 0; field[n]; n++)
fprintf(fout, "%s: %s\n", field[n], fdata[n]);
- n = time(NULL);
- fprintf(fout, "Date: %s\n", Cdate((time_t *) & n));
+ fprintf(fout, "Date: %s\n", Cdate(&now));
fprintf(fout, "Approved: %s\n", uid);
fprintf(fout, "----\n");
fclose(fout);
@@ -1046,8 +1044,7 @@ int give_money() {
FILE *fp, *fp2;
char *ptr, *id, *mn;
char buf[200] = {0}, tt[TTLEN + 1] = {0};
- time_t t = time(NULL);
- struct tm *pt = localtime(&t);
+ struct tm *pt = localtime(&now);
int to_all = 0, money = 0;
getdata(0, 0, "指定使用者(S) 全站使用者(A) 取消(Q)?[S]", buf, sizeof(buf), LCECHO);
@@ -1094,7 +1091,7 @@ int give_money() {
if(bad_user_id(uhash->userid[i]))
continue;
id = uhash->userid[i];
- give_id_money(id, money, fp2, tt, t);
+ give_id_money(id, money, fp2, tt, now);
}
} else {
if(!(fp = fopen("etc/givemoney.txt", "r+"))) {
@@ -1108,7 +1105,7 @@ int give_money() {
*ptr = '\0';
id = buf;
mn = ptr + 1;
- give_id_money(id, atoi(mn), fp2, tt, t);
+ give_id_money(id, atoi(mn), fp2, tt, now);
}
fclose(fp);
}