summaryrefslogtreecommitdiffstats
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
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
-rw-r--r--util/birth.c26
-rw-r--r--util/horoscope.c32
-rw-r--r--util/yearsold.c8
3 files changed, 33 insertions, 33 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);
}
}
}
diff --git a/util/horoscope.c b/util/horoscope.c
index 04479108..936c2727 100644
--- a/util/horoscope.c
+++ b/util/horoscope.c
@@ -2,7 +2,7 @@
#define _UTIL_C_
#include "bbs.h"
-struct userec_t cuser;
+struct userec_t user;
int main() {
int i, j, k;
@@ -37,79 +37,79 @@ int main() {
if(passwd_init())
exit(1);
for(k = 1; k <= MAX_USERS; k++) {
- passwd_query(k, &cuser);
- if(!cuser.userid[0])
+ passwd_query(k, &user);
+ if(!user.userid[0])
continue;
- switch (cuser.month)
+ switch (user.month)
{
case 1:
- if (cuser.day <= 19)
+ if (user.day <= 19)
act[9]++;
else
act[10]++;
break;
case 2:
- if (cuser.day <= 18)
+ if (user.day <= 18)
act[10]++;
else
act[11]++;
break;
case 3:
- if (cuser.day <= 20)
+ if (user.day <= 20)
act[11]++;
else
act[0]++;
break;
case 4:
- if (cuser.day <= 19)
+ if (user.day <= 19)
act[0]++;
else
act[1]++;
break;
case 5:
- if (cuser.day <= 20)
+ if (user.day <= 20)
act[1]++;
else
act[2]++;
break;
case 6:
- if (cuser.day <= 21)
+ if (user.day <= 21)
act[2]++;
else
act[3]++;
break;
case 7:
- if (cuser.day <= 22)
+ if (user.day <= 22)
act[3]++;
else
act[4]++;
break;
case 8:
- if (cuser.day <= 22)
+ if (user.day <= 22)
act[4]++;
else
act[5]++;
break;
case 9:
- if (cuser.day <= 22)
+ if (user.day <= 22)
act[5]++;
else
act[6]++;
break;
case 10:
- if (cuser.day <= 23)
+ if (user.day <= 23)
act[6]++;
else
act[7]++;
break;
case 11:
- if (cuser.day <= 22)
+ if (user.day <= 22)
act[7]++;
else
act[8]++;
break;
case 12:
- if (cuser.day <= 21)
+ if (user.day <= 21)
act[8]++;
else
act[9]++;
diff --git a/util/yearsold.c b/util/yearsold.c
index b4b0d176..83b43fa9 100644
--- a/util/yearsold.c
+++ b/util/yearsold.c
@@ -5,7 +5,7 @@
#define YEARSOLD_MAX_LINE 16
-struct userec_t cuser;
+struct userec_t user;
void
fouts(fp, buf, mode)
@@ -43,12 +43,12 @@ int main(int argc, char **argv)
memset(act, 0, sizeof(act));
for(k = 1; k <= MAX_USERS; k++) {
- passwd_query(k, &cuser);
- if (((ptime->tm_year - cuser.year) < 10) || ((ptime->tm_year - cuser.year) >
+ passwd_query(k, &user);
+ if (((ptime->tm_year - user.year) < 10) || ((ptime->tm_year - user.year) >
33))
continue;
- act[ptime->tm_year - cuser.year - 10]++;
+ act[ptime->tm_year - user.year - 10]++;
act[24]++;
}