summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-04-20 13:03:38 +0800
committerptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-04-20 13:03:38 +0800
commitbffec9c361a10cdb3ece67e86419b85af7a7cc95 (patch)
tree65aca7271d9605c2a30a5188350511bbe9b152b0
parentc767a1d53864d088cd4c53b58ee930932f728a9a (diff)
downloadpttbbs-bffec9c361a10cdb3ece67e86419b85af7a7cc95.tar
pttbbs-bffec9c361a10cdb3ece67e86419b85af7a7cc95.tar.gz
pttbbs-bffec9c361a10cdb3ece67e86419b85af7a7cc95.tar.bz2
pttbbs-bffec9c361a10cdb3ece67e86419b85af7a7cc95.tar.lz
pttbbs-bffec9c361a10cdb3ece67e86419b85af7a7cc95.tar.xz
pttbbs-bffec9c361a10cdb3ece67e86419b85af7a7cc95.tar.zst
pttbbs-bffec9c361a10cdb3ece67e86419b85af7a7cc95.zip
buggy fix for linux
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1794 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--mbbsd/board.c2
-rw-r--r--mbbsd/user.c44
2 files changed, 23 insertions, 23 deletions
diff --git a/mbbsd/board.c b/mbbsd/board.c
index 6844bb50..14a01ced 100644
--- a/mbbsd/board.c
+++ b/mbbsd/board.c
@@ -124,7 +124,7 @@ check_newpost(boardstat_t * ptr)
time_t *tbrc_list;
ptr->myattr &= ~NBRD_UNREAD;
- if (B_BH(ptr)->brdattr & BRD_GROUPBOARD)
+ if (B_BH(ptr)->brdattr & (BRD_GROUPBOARD | BRD_SYMBOLIC))
return 0;
if (B_TOTAL(ptr) == 0)
diff --git a/mbbsd/user.c b/mbbsd/user.c
index 74dd74d4..00c41c27 100644
--- a/mbbsd/user.c
+++ b/mbbsd/user.c
@@ -12,7 +12,7 @@ int
kill_user(int num)
{
userec_t u;
- memset(&u, 0, sizeof(u));
+ memset(&u, 0, sizeof(userec_t));
log_usies("KILL", getuserid(num));
setuserid(num, "");
passwd_update(num, &u);
@@ -33,7 +33,7 @@ u_loginview()
clrtobot();
while (getdata(b_lines - 1, 0, "�� [A-N] �����]�w�A�� [Return] �����G",
- choice, sizeof(choice), LCECHO)) {
+ choice, 3, LCECHO)) {
i = choice[0] - 'a';
if (i >= NUMVIEWFILE || i < 0)
bell();
@@ -97,7 +97,7 @@ user_display(userec_t * u, int real)
u->numlogins, u->numposts);
if (real) {
- strlcpy(genbuf, "bTCPRp#@XWBA#VSM0123456789ABCDEF", sizeof(genbuf));
+ strcpy(genbuf, "bTCPRp#@XWBA#VSM0123456789ABCDEF");
for (diff = 0; diff < 32; diff++)
if (!(u->userlevel & (1 << diff)))
genbuf[diff] = '-';
@@ -144,7 +144,7 @@ mail_violatelaw(char *crime, char *police, char *reason, char *result)
char genbuf[200];
fileheader_t fhdr;
FILE *fp;
- snprintf(genbuf, sizeof(genbuf), "home/%c/%s", crime[0], crime);
+ snprintf(genbuf, 200, "home/%c/%s", crime[0], crime);
stampfile(genbuf, &fhdr);
if (!(fp = fopen(genbuf, "w")))
return;
@@ -156,9 +156,9 @@ mail_violatelaw(char *crime, char *police, char *reason, char *result)
"\n�Ш� PttLaw �d�߬����k�W��T�A�è� Play-Pay-ViolateLaw ú��@��",
ctime(&now), police, crime, reason, result);
fclose(fp);
- snprintf(fhdr.title, sizeof(fhdr.title), "[���i] �H�k�P�M���i");
- strlcpy(fhdr.owner, "[Ptt�k�|]", sizeof(fhdr.owner));
- snprintf(genbuf, sizeof(genbuf), "home/%c/%s/.DIR", crime[0], crime);
+ strcpy(fhdr.title, "[���i] �H�k�P�M���i");
+ strcpy(fhdr.owner, "[Ptt�k�|]");
+ snprintf(genbuf, 200, "home/%c/%s/.DIR", crime[0], crime);
append_record(genbuf, &fhdr, sizeof(fhdr));
}
@@ -172,16 +172,16 @@ violate_law(userec_t * u, int unum)
move(2, 0);
prints("(1)Cross-post (2)�õo�s�i�H (3)�õo�s��H\n");
prints("(4)���Z���W�ϥΪ� (8)��L�H�@��B�m�欰\n(9)�� id �欰\n");
- getdata(5, 0, "(0)����", ans, sizeof(ans), DOECHO);
+ getdata(5, 0, "(0)����", ans, 3, DOECHO);
switch (ans[0]) {
case '1':
- snprintf(reason, sizeof(reason), "%s", "Cross-post");
+ strcpy(reason, "Cross-post");
break;
case '2':
- snprintf(reason, sizeof(reason), "%s", "�õo�s�i�H");
+ strcpy(reason, "�õo�s�i�H");
break;
case '3':
- snprintf(reason, sizeof(reason), "%s", "�õo�s��H");
+ strcpy(reason, "�õo�s��H");
break;
case '4':
while (!getdata(7, 0, "�п�J�Q���|�z�ѥH�ܭt�d�G", reason, 50, DOECHO));
@@ -194,7 +194,7 @@ violate_law(userec_t * u, int unum)
default:
return;
}
- getdata(7, 0, msg_sure_ny, ans2, sizeof(ans2), LCECHO);
+ getdata(7, 0, msg_sure_ny, ans2, 3, LCECHO);
if (*ans2 != 'y')
return;
if (ans[0] == '9') {
@@ -237,7 +237,7 @@ static void Customize(void)
prints("%-30s%10s\n", "E. ���G����ܧڪ��̷R",
((cuser->uflag2 & FAVNOHILIGHT) ? "�_" : "�O"));
getdata(b_lines - 1, 0, "�� [A-E] �����]�w�A�� [Return] �����G",
- ans, sizeof(ans), DOECHO);
+ ans, 3, DOECHO);
switch( ans[0] ){
case 'A':
@@ -1286,7 +1286,7 @@ u_register(void)
REGFORM:
getdata(b_lines - 1, 0, "�z�T�w�n��g���U���(Y/N)�H[N] ",
- ans, sizeof(ans), LCECHO);
+ ans, 3, LCECHO);
if (ans[0] != 'y')
return FULLUPDATE;
@@ -1323,7 +1323,7 @@ u_register(void)
getfield(4, "0123456789","�����Ҹ� �@�Ӹ��X �� SSN", ident, 11);
move(6, 2);
prints("���X���~�̱N�L�k���o�i�@�B���v���I");
- getdata(7, 2, "�O�_�T�w(Y/N)", ans, sizeof(ans), LCECHO);
+ getdata(7, 2, "�O�_�T�w(Y/N)", ans, 3, LCECHO);
if (ans[0] == 'y' || ans[0] == 'Y')
break;
vmsg("�Э��s��J(�Y�����D�·Ц�SYSOP�O)");
@@ -1391,7 +1391,7 @@ u_register(void)
getfield(17, "���/���/�褸 �p:09/27/76", "�ͤ�", birthday, 9);
len = strlen(birthday);
if (!len) {
- snprintf(birthday, sizeof(birthday), "%02i/%02i/%02i",
+ snprintf(birthday, 9, "%02i/%02i/%02i",
cuser->month, cuser->day, cuser->year % 100);
mon = cuser->month;
day = cuser->day;
@@ -1413,16 +1413,16 @@ u_register(void)
}
getfield(19, "1.���� 2.�j�� ", "�ʧO", sex_is, 2);
getdata(20, 0, "�H�W��ƬO�_���T(Y/N)�H(Q)�������U [N] ",
- ans, sizeof(ans), LCECHO);
+ ans, 3, LCECHO);
if (ans[0] == 'q')
return 0;
if (ans[0] == 'y')
break;
}
- strlcpy(cuser->ident, ident, sizeof(cuser->ident));
- strlcpy(cuser->realname, rname, sizeof(cuser->realname));
- strlcpy(cuser->address, addr, sizeof(cuser->address));
- strlcpy(cuser->email, email, sizeof(cuser->email));
+ strlcpy(cuser->ident, ident,11);
+ strlcpy(cuser->realname, rname, 20);
+ strlcpy(cuser->address, addr, 50);
+ strlcpy(cuser->email, email, 50);
cuser->mobile = atoi(mobile);
cuser->sex = (sex_is[0] - '1') % 8;
cuser->month = mon;
@@ -1494,7 +1494,7 @@ u_list_CB(int num, userec_t * uentp)
clrtobot();
}
level = uentp->userlevel;
- strlcpy(permstr, "----", sizeof(permstr));
+ strlcpy(permstr, "----", 8);
if (level & PERM_SYSOP)
permstr[0] = 'S';
else if (level & PERM_ACCOUNTS)