summaryrefslogtreecommitdiffstats
path: root/util/birth.c
diff options
context:
space:
mode:
authorptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-03-31 09:24:38 +0800
committerptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-03-31 09:24:38 +0800
commitb12f10b3f034ab09558c7040b7c5ed254e76d680 (patch)
tree3021d28cdbdc5678fe8761b85d5c6f80357a3ee8 /util/birth.c
parent2c775c59bd63b03eb301232e888163d041e15afe (diff)
downloadpttbbs-b12f10b3f034ab09558c7040b7c5ed254e76d680.tar
pttbbs-b12f10b3f034ab09558c7040b7c5ed254e76d680.tar.gz
pttbbs-b12f10b3f034ab09558c7040b7c5ed254e76d680.tar.bz2
pttbbs-b12f10b3f034ab09558c7040b7c5ed254e76d680.tar.lz
pttbbs-b12f10b3f034ab09558c7040b7c5ed254e76d680.tar.xz
pttbbs-b12f10b3f034ab09558c7040b7c5ed254e76d680.tar.zst
pttbbs-b12f10b3f034ab09558c7040b7c5ed254e76d680.zip
debug cuser
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1645 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'util/birth.c')
-rw-r--r--util/birth.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/util/birth.c b/util/birth.c
index 20bd65c0..4a4a6fd0 100644
--- a/util/birth.c
+++ b/util/birth.c
@@ -5,18 +5,18 @@
#define OUTFILE BBSHOME "/etc/birth.today"
-struct userec_t cuser;
+struct userec_t user;
int bad_user_id(char *userid) {
register char ch;
int j;
- if (strlen(cuser.userid) < 2 || !isalpha(cuser.userid[0]))
+ if (strlen(user.userid) < 2 || !isalpha(user.userid[0]))
return 1;
- if (cuser.numlogins == 0 || cuser.numlogins > 15000)
+ if (user.numlogins == 0 || user.numlogins > 15000)
return 1;
- if (cuser.numposts > 15000)
+ if (user.numposts > 15000)
return 1;
- for (j = 1; (ch = cuser.userid[j]); j++)
+ for (j = 1; (ch = user.userid[j]); j++)
{
if (!isalnum(ch))
return 1;
@@ -60,29 +60,29 @@ int main(argc, argv)
"¡¹¡¹¡¹¡¹¡¹¡¹ \n\n");
fprintf(fp1, "¡i¥»¤é¹Ø¬P¡j \n");
for(j = 1; j <= MAX_USERS; j++) {
- passwd_query(j, &cuser);
+ passwd_query(j, &user);
if (bad_user_id(NULL))
continue;
- if (cuser.month == ptime->tm_mon + 1)
+ if (user.month == ptime->tm_mon + 1)
{
- if (cuser.day == ptime->tm_mday)
+ if (user.day == ptime->tm_mday)
{
char genbuf[200];
- sprintf(genbuf, BBSHOME "/home/%c/%s", cuser.userid[0], cuser.userid);
+ sprintf(genbuf, BBSHOME "/home/%c/%s", user.userid[0], user.userid);
stampfile(genbuf, &mymail);
strcpy(mymail.owner, BBSNAME);
strcpy(mymail.title, "!! ¥Í¤é§Ö¼Ö !!");
unlink(genbuf);
Link(BBSHOME "/etc/Welcome_birth", genbuf);
- sprintf(genbuf, BBSHOME "/home/%c/%s/.DIR", cuser.userid[0], cuser.userid);
+ sprintf(genbuf, BBSHOME "/home/%c/%s/.DIR", user.userid[0], user.userid);
append_record(genbuf, &mymail, sizeof(mymail));
- if ((cuser.numlogins + cuser.numposts) < 20)
+ if ((user.numlogins + user.numposts) < 20)
continue;
fprintf(fp1,
" [%2d/%-2d] %-14s %-24s login:%-5d post:%-5d\n",
- ptime->tm_mon + 1, ptime->tm_mday, cuser.userid,
- cuser.username, cuser.numlogins, cuser.numposts);
+ ptime->tm_mon + 1, ptime->tm_mday, user.userid,
+ user.username, user.numlogins, user.numposts);
}
}
}