diff options
Diffstat (limited to 'mbbsd')
-rw-r--r-- | mbbsd/admin.c | 23 | ||||
-rw-r--r-- | mbbsd/announce.c | 14 | ||||
-rw-r--r-- | mbbsd/bbs.c | 22 | ||||
-rw-r--r-- | mbbsd/board.c | 18 | ||||
-rw-r--r-- | mbbsd/cal.c | 2 | ||||
-rw-r--r-- | mbbsd/card.c | 14 | ||||
-rw-r--r-- | mbbsd/chc.c | 2 | ||||
-rw-r--r-- | mbbsd/chicken.c | 2 | ||||
-rw-r--r-- | mbbsd/dark.c | 8 | ||||
-rw-r--r-- | mbbsd/dice.c | 98 | ||||
-rw-r--r-- | mbbsd/edit.c | 7 | ||||
-rw-r--r-- | mbbsd/friend.c | 4 | ||||
-rw-r--r-- | mbbsd/gamble.c | 14 | ||||
-rw-r--r-- | mbbsd/guess.c | 30 | ||||
-rw-r--r-- | mbbsd/kaede.c | 13 | ||||
-rw-r--r-- | mbbsd/lovepaper.c | 4 | ||||
-rw-r--r-- | mbbsd/mail.c | 10 | ||||
-rw-r--r-- | mbbsd/mbbsd.c | 2 | ||||
-rw-r--r-- | mbbsd/menu.c | 5 | ||||
-rw-r--r-- | mbbsd/othello.c | 62 | ||||
-rw-r--r-- | mbbsd/page.c | 8 | ||||
-rw-r--r-- | mbbsd/read.c | 4 | ||||
-rw-r--r-- | mbbsd/register.c | 2 | ||||
-rw-r--r-- | mbbsd/screen.c | 4 | ||||
-rw-r--r-- | mbbsd/stuff.c | 2 | ||||
-rw-r--r-- | mbbsd/syspost.c | 2 | ||||
-rw-r--r-- | mbbsd/talk.c | 36 | ||||
-rw-r--r-- | mbbsd/user.c | 22 | ||||
-rw-r--r-- | mbbsd/vice.c | 8 | ||||
-rw-r--r-- | mbbsd/vote.c | 19 | ||||
-rw-r--r-- | mbbsd/voteboard.c | 26 |
31 files changed, 240 insertions, 247 deletions
diff --git a/mbbsd/admin.c b/mbbsd/admin.c index a1a879f7..96b65ccd 100644 --- a/mbbsd/admin.c +++ b/mbbsd/admin.c @@ -10,7 +10,7 @@ m_loginmsg() clrtobot(); if(SHM->loginmsg.pid && SHM->loginmsg.pid != currutmp->pid) { - prints("�ثe�w�g���H�U�� �i�����y�]�w�Х���զn�A�]�w.."); + outs("�ثe�w�g���H�U�� �i�����y�]�w�Х���զn�A�]�w.."); getmessage(SHM->loginmsg); } getdata(22, 0, @@ -241,7 +241,7 @@ setperms(unsigned int pbits, char * const pstring[]) else { pbits ^= (1 << i); move(i % 16 + 4, i <= 15 ? 24 : 64); - prints((pbits >> i) & 1 ? "��" : "��"); + outs((pbits >> i) & 1 ? "��" : "��"); } } return pbits; @@ -911,7 +911,7 @@ scan_register_form(char *regfile, int automode, int neednum) move(1, 0); clrtobot(); prints("�U��㦳�����v�����H�A���U��ֿn�W�L�@�ʥ��F�A�·бz�����f %d ��\n", neednum); - prints("�]�N�O�j���G�Q�����@���ƶq�A���M�A�z�]�i�H�h�f\n�S�f�����e�A�t�Τ��|���A���X��I����"); + outs("�]�N�O�j���G�Q�����@���ƶq�A���M�A�z�]�i�H�h�f\n�S�f�����e�A�t�Τ��|���A���X��I����"); pressanykey(); } memset(fdata, 0, sizeof(fdata)); @@ -980,7 +980,7 @@ scan_register_form(char *regfile, int automode, int neednum) if (neednum > 0 && ans[0] == 'q') { move(2, 0); clrtobot(); - prints("�S�f������h�X"); + outs("�S�f������h�X"); pressanykey(); ans[0] = 's'; } @@ -1006,7 +1006,7 @@ scan_register_form(char *regfile, int automode, int neednum) for (n = 0; field[n]; n++) prints("%s: %s\n", finfo[n], fdata[n]); move(9, 0); - prints("�д��X�h�^�ӽЪ���]�A�� <enter> ����\n"); + outs("�д��X�h�^�ӽЪ���]�A�� <enter> ����\n"); for (n = 0; reason[n]; n++) prints("%d) ��%s\n", n, reason[n]); } else @@ -1031,9 +1031,8 @@ scan_register_form(char *regfile, int automode, int neednum) for(i = 0; buf[i] && i < sizeof(buf); i++){ if (!isdigit(buf[i])) continue; - snprintf(genbuf, sizeof(genbuf), - "[�h�^��]] ��%s", reason[buf[i] - '0']); - fprintf(fp, "%s\n", genbuf); + fputs("[�h�^��]] ��", fp); + fputs(reason[buf[i] - '0'], fp); } fclose(fp); @@ -1050,7 +1049,7 @@ scan_register_form(char *regfile, int automode, int neednum) } move(10, 0); clrtobot(); - prints("�����h�^�����U�ӽЪ�"); + outs("�����h�^�����U�ӽЪ�"); case 's': if ((freg = fopen(regfile, "a"))) { for (n = 0; field[n]; n++) @@ -1060,7 +1059,7 @@ scan_register_form(char *regfile, int automode, int neednum) } break; default: - prints("�H�U�ϥΪ̸�Ƥw�g��s:\n"); + outs("�H�U�ϥΪ̸�Ƥw�g��s:\n"); mail_muser(muser, "[���U���\\�o]", "etc/registered"); if(muser.uflag2 & FOREIGN) mail_muser(muser, "[�X�J�Һz��]", "etc/foreign_welcome"); @@ -1203,7 +1202,7 @@ give_money() money = atoi(buf); if (money <= 0) { move(2, 0); - prints("��J���~!!"); + outs("��J���~!!"); pressanykey(); return 1; } @@ -1226,7 +1225,7 @@ give_money() getdata(1, 0, "���]�U���D �G", tt, TTLEN, DOECHO); move(2, 0); - prints("�s���]�U���e"); + outs("�s���]�U���e"); pressanykey(); if (vedit("etc/givemoney.why", NA, NULL) < 0) { fclose(fp2); diff --git a/mbbsd/announce.c b/mbbsd/announce.c index 092723db..844a6f72 100644 --- a/mbbsd/announce.c +++ b/mbbsd/announce.c @@ -243,16 +243,16 @@ a_newitem(menu_t * pm, int mode) currboard[0], currboard, buf); break; case 1: - snprintf(lpath, sizeof(lpath), "%s%s/%c/%s", - BBSHOME, "/man/boards/", buf[0], buf); + snprintf(lpath, sizeof(lpath), BBSHOME "/man/boards/%c/%s", + buf[0], buf); break; case 2: - snprintf(lpath, sizeof(lpath), "%s%s%s", - BBSHOME, "/", buf); + snprintf(lpath, sizeof(lpath), BBSHOME "/%s", + buf); break; case 3: - snprintf(lpath, sizeof(lpath), "%s%s%s", - BBSHOME, "/etc/", buf); + snprintf(lpath, sizeof(lpath), BBSHOME "/etc/%s", + buf); break; } if (dashf(lpath)) { @@ -1093,7 +1093,7 @@ void BlogMain(int num) showtitle("������", genbuf); while( !exit ){ move(1, 0); - prints("�п�ܱz�n���檺���@:\n" + outs("�п�ܱz�n���檺���@:\n" "0.�^��W�@�h\n" "1.�s�@������˪O�榡\n" " �ϥηs�� config �ؿ��U�˪O���\n" diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c index 27e93996..f0acc4ec 100644 --- a/mbbsd/bbs.c +++ b/mbbsd/bbs.c @@ -70,9 +70,9 @@ save_violatelaw() return 0; } move(5, 0); - prints("\033[1;37m�A���D��? �]���A���H�k " + outs("\033[1;37m�A���D��? �]���A���H�k " "�w�g�y���ܦh�H�����K\033[m\n"); - prints("\033[1;37m�A�O�_�T�w�H�ᤣ�|�A�ǤF�H\033[m\n"); + outs("\033[1;37m�A�O�_�T�w�H�ᤣ�|�A�ǤF�H\033[m\n"); if (!getdata(10, 0, "�T�w�ܡH[y/n]:", ok, sizeof(ok), LCECHO) || ok[0] == 'n' || ok[0] == 'N') { @@ -490,7 +490,7 @@ print_bidinfo(FILE *io, bid_t bidinfo) prints("�����ʶR��:%-20d",bidinfo.buyitnow); if(bidinfo.shipping) prints("�B�O:%d", bidinfo.shipping); - prints("\n"); + outc('\n'); } } @@ -561,7 +561,7 @@ do_general(int isbid) else { if (!isbid) { move(21,0); - prints("�����G"); + outs("�����G"); for(i=0; i<8 && bp->posttype[i*4]; i++) strncpy(ctype[i],bp->posttype+4*i,4); if(i==0) i=8; @@ -674,9 +674,9 @@ do_general(int isbid) if (strcmp(currboard, "Test") && !ifuseanony) { prints("�o�O�z���� %d �g�峹�C",++cuser.numposts); if(postfile.filemode&FILE_BID) - prints("�ۼФ峹�S���Z�S�C"); + outs("�ۼФ峹�S���Z�S�C"); else if(currbrdattr&BRD_BAD) - prints("�H�k��i���ݪO�S���Z�S�C"); + outs("�H�k��i���ݪO�S���Z�S�C"); else { prints(" �Z�S %d �ȡC",aborted); @@ -1195,7 +1195,7 @@ hold_gamble(int ent, fileheader_t * fhdr, char *direct) bp->endgamble ? Cdate(&bp->endgamble) : "" ); strcat(msg, genbuf); - prints("�Ш̦���J�m���W��, �ݴ���2~8��. (�����K��, ��J������enter)\n"); + outs("�Ш̦���J�m���W��, �ݴ���2~8��. (�����K��, ��J������enter)\n"); for (i = 0; i < 8; i++) { snprintf(yn, sizeof(yn), " %d)", i + 1); getdata(7 + i, 0, yn, genbuf, 9, DOECHO); @@ -1211,7 +1211,7 @@ hold_gamble(int ent, fileheader_t * fhdr, char *direct) unlink(genbuf); // Ptt: �����Q�Τ��Pid�P���|���� move(8 + i, 0); - prints("��L�]�w����"); + outs("��L�]�w����"); snprintf(genbuf, sizeof(genbuf), "[���i] %s �O �}�l���!", currboard); post_msg(currboard, genbuf, msg, cuser.userid); post_msg("Record", genbuf + 7, msg, "[�������l]"); @@ -1365,7 +1365,7 @@ do_bid(int ent, fileheader_t * fhdr, boardheader_t *bp, char *direct, struct t if(!bidinfo.payby) money="Ptt$ "; else money=" NT$ "; if(now>bidinfo.enddate || bidinfo.high==bidinfo.buyitnow) { - prints("���v�Фw�g����,"); + outs("���v�Фw�g����,"); if( bidinfo.userid[0]) { /*if(!payby && bidinfo.usermax!=-1) {�HPtt���۰ʦ��� @@ -1391,7 +1391,7 @@ do_bid(int ent, fileheader_t * fhdr, boardheader_t *bp, char *direct, struct t } #endif } - else prints("�L�H�o��!"); + else outs("�L�H�o��!"); pressanykey(); return FULLUPDATE; } @@ -1409,7 +1409,7 @@ do_bid(int ent, fileheader_t * fhdr, boardheader_t *bp, char *direct, struct t } if(!strcmp(cuser.userid,bidinfo.userid)) { - prints("�A�O�̰��o�Ъ�!"); + outs("�A�O�̰��o�Ъ�!"); pressanykey(); return FULLUPDATE; } diff --git a/mbbsd/board.c b/mbbsd/board.c index 27ce6021..0a93dde2 100644 --- a/mbbsd/board.c +++ b/mbbsd/board.c @@ -417,7 +417,7 @@ show_brdlist(int head, int clsflag, int newflag) move(1, 0); outs( " " - "�� �~�X\033[33m��\n" + "�� ���X\033[33m��\n" " ��X \033[m " "���i\033[47m��\033[40m�i�i����\n" " \033[44m �s�s�s�s�s�s�s�s " @@ -484,7 +484,7 @@ show_brdlist(int head, int clsflag, int newflag) } if (class_bid == 1) - prints(" "); + outs(" "); else { if (!GROUPOP() && !HasPerm(B_BH(ptr))) { prints("%5d Unknown?? ���O �H�o�ӪO�O���O", head); @@ -501,7 +501,7 @@ show_brdlist(int head, int clsflag, int newflag) unread[ptr->myattr & NBRD_UNREAD ? 1 : 0]); } else { if (B_BH(ptr)->brdattr & BRD_GROUPBOARD) - prints(" "); + outs(" "); else prints("%6d%s", (int)(B_TOTAL(ptr)), unread[ptr->myattr & NBRD_UNREAD ? 1 : 0]); @@ -518,15 +518,15 @@ show_brdlist(int head, int clsflag, int newflag) B_BH(ptr)->title, B_BH(ptr)->title + 5, B_BH(ptr)->title + 7); if (B_BH(ptr)->brdattr & BRD_BAD) - prints(" X "); + outs(" X "); else if (B_BH(ptr)->nuser >= 5000) - prints("\033[1;34m�z!\033[m"); + outs("\033[1;34m�z!\033[m"); else if (B_BH(ptr)->nuser >= 2000) - prints("\033[1;31m�z!\033[m"); + outs("\033[1;31m�z!\033[m"); else if (B_BH(ptr)->nuser >= 1000) - prints("\033[1m�z!\033[m"); + outs("\033[1m�z!\033[m"); else if (B_BH(ptr)->nuser >= 100) - prints("\033[1mHOT\033[m"); + outs("\033[1mHOT\033[m"); else if (B_BH(ptr)->nuser > 50) prints("\033[1;31m%2d\033[m ", B_BH(ptr)->nuser); else if (B_BH(ptr)->nuser > 10) @@ -792,7 +792,7 @@ choose_board(int newflag) case 'S': if(yank_flag == 0){ move(b_lines - 2, 0); - prints("���s�ƧǬݪO " + outs("���s�ƧǬݪO " "\033[1;33m(�`�N, �o�Ӱʧ@�|�мg��ӳ]�w)\033[m \n"); tmp = getans("�ƧǤ覡 (1)���ӪO�W�Ƨ� (2)�������O�Ƨ� ==> [0]���� "); if( tmp == '1' ) diff --git a/mbbsd/cal.c b/mbbsd/cal.c index 521954c3..34e9de57 100644 --- a/mbbsd/cal.c +++ b/mbbsd/cal.c @@ -428,7 +428,7 @@ p_sysinfo(void) #ifdef CPULIMIT prints(" (limit %d secs)", CPULIMIT * 60); #endif - prints("\n�S�O�Ѽ�:" + outs("\n�S�O�Ѽ�:" #ifdef CRITICAL_MEMORY " CRITICAL_MEMORY" #endif diff --git a/mbbsd/card.c b/mbbsd/card.c index b46ce2bc..6e9a63ed 100644 --- a/mbbsd/card.c +++ b/mbbsd/card.c @@ -84,11 +84,11 @@ card_display(int cline, int number, int flower, int show) if (flower == 0 || flower == 3) color = 36; if ((show < 0) && (cline > 1 && cline < 8)) - prints("�x\033[1;33;42m��������\033[m�x"); + outs("�x\033[1;33;42m��������\033[m�x"); else switch (cline) { case 1: - prints("�~�w�w�w�w��"); + outs("�~�w�w�w�w��"); break; case 2: prints("�x\033[1;%dm%s\033[m �x", color, cn[number - 1]); @@ -127,7 +127,7 @@ card_display(int cline, int number, int flower, int show) prints("�x \033[1;%dm%s\033[m�x", color, cn[number - 1]); break; case 8: - prints("���w�w�w�w��"); + outs("���w�w�w�w��"); break; } } @@ -176,12 +176,12 @@ card_start(char name[]) clear(); stand_title(name); move(1, 0); - prints(" \033[1;33;41m �q �� \033[m"); + outs(" \033[1;33;41m �q �� \033[m"); move(10, 0); - prints("\033[1;34;44m���㡻�㡻�㡻�㡻�㡻�㡻�㡻�㡻�㡻�㡻�㡻��" + outs("\033[1;34;44m���㡻�㡻�㡻�㡻�㡻�㡻�㡻�㡻�㡻�㡻�㡻��" "���㡻�㡻�㡻�㡻�㡻�㡻�㡻\033[m"); move(19, 0); - prints(" \033[1;37;42m �� �v \033[m"); + outs(" \033[1;37;42m �� �v \033[m"); } static int @@ -283,7 +283,7 @@ card_99() move(21, 0); clrtoeol(); prints("[0]�ثe %d , �� %d �I\n", count, 99 - count); - prints("���k�䲾�ʴ��, [Enter]�T�w, [ + ]���[�G�Q(�[�Q), [Q/q]���C��"); + outs("���k�䲾�ʴ��, [Enter]�T�w, [ + ]���[�G�Q(�[�Q), [Q/q]���C��"); while (1) { i = card_select(&j); if (i == 0) /* ���C�� */ diff --git a/mbbsd/chc.c b/mbbsd/chc.c index 373b97a0..4824af0f 100644 --- a/mbbsd/chc.c +++ b/mbbsd/chc.c @@ -177,7 +177,7 @@ showstep(board_t board) prints("�G %s%s", CHE_O(eatten) == 0 ? BLACK_COLOR : RED_COLOR, chess_str[CHE_O(eatten)][CHE_P(eatten)]); - prints("\033[m"); + outs("\033[m"); } static void diff --git a/mbbsd/chicken.c b/mbbsd/chicken.c index 4050067c..2b3948e9 100644 --- a/mbbsd/chicken.c +++ b/mbbsd/chicken.c @@ -253,7 +253,7 @@ show_chicken_data(chicken_t * thechicken, chicken_t * pkchicken) outs("������.."); if (pkchicken) { - outs("\n"); + outc('\n'); show_chicken_stat(pkchicken); outs("[���N��] ������� [q] ���] [o] �Y�j�ɤY"); } diff --git a/mbbsd/dark.c b/mbbsd/dark.c index c567cced..03777a2e 100644 --- a/mbbsd/dark.c +++ b/mbbsd/dark.c @@ -163,7 +163,7 @@ draw_line(sint y, sint f) move(cury[y], 3); clrtoeol(); - prints("%s", buf); + outs(buf); } static void @@ -307,7 +307,7 @@ playing(sint fd, sint color, sint ch, sint * b, userinfo_t * uin) else rcount--; move(cur_eaty, cur_eatx); - prints("%s", (color) ? bname[brd[my][mx].value] : rname[brd[my][mx].value]); + outs((color) ? bname[brd[my][mx].value] : rname[brd[my][mx].value]); if (cur_eatx >= 26) { cur_eatx = 5; cur_eaty++; @@ -524,11 +524,11 @@ main_dark(int fd, userinfo_t * uin) if (currutmp->turn == 'w') { move(22, 0); clrtoeol(); - prints("[1;31m�AĹ�F.. �u�O����~~[m"); + outs("[1;31m�AĹ�F.. �u�O����~~[m"); } else { move(22, 0); clrtoeol(); - prints("[1;31m�鱼�F��.....�U�����L�n��!![m"); + outs("[1;31m�鱼�F��.....�U�����L�n��!![m"); } break; case -3: diff --git a/mbbsd/dice.c b/mbbsd/dice.c index d6fc0c55..b385a60f 100644 --- a/mbbsd/dice.c +++ b/mbbsd/dice.c @@ -95,29 +95,29 @@ static void show_data(void) { move(0, 0); - prints("\033[31m �z�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w" + outs("\033[31m �z�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w" "�w�w�w�w�w�w�w�w�w�w�{\033[m\n"); - prints("\033[45;37m���v�@\033[m\033[31m �x \033[33m[1]��@�I [2]��G�I " + outs("\033[45;37m���v�@\033[m\033[31m �x \033[33m[1]��@�I [2]��G�I " "[3]��T�I [4]��|�I [5]�㤭�I [6]�㤻�I \033[31m �x\033[m\n"); - prints("\033[31m �x \033[33m[7]��p [8]��j " + outs("\033[31m �x \033[33m[7]��p [8]��j " " \033[31m �x\033[m\n"); - prints("\033[31m �x " + outs("\033[31m �x " " �x\033[m\n"); - prints("\033[45;37m�߲v�T\033[m\033[31m �x \033[33m[11]�㤤(�`�I�Ƶ���11" + outs("\033[45;37m�߲v�T\033[m\033[31m �x \033[33m[11]�㤤(�`�I�Ƶ���11" "��10) \033[31m �x\033[m\n"); - prints("\033[31m �x " + outs("\033[31m �x " " �x\033[m\n"); - prints("\033[45;37m�߲v��\033[m\033[31m �x \033[33m[74]��p�B�|�I [83]��" + outs("\033[45;37m�߲v��\033[m\033[31m �x \033[33m[74]��p�B�|�I [83]��" "�j�B�T�I [66]��s�� \033[31m �x\033[m\n"); - prints("\033[31m �x " + outs("\033[31m �x " " �x\033[m\n"); - prints("\033[31m �x \033[33m[12]��@�G�I [13]��@�T�I [14]��@�|�I" + outs("\033[31m �x \033[33m[12]��@�G�I [13]��@�T�I [14]��@�|�I" " [15]��@���I [16]��@���I\033[31m �x\033[m\n"); - prints("\033[31m �x \033[33m[23]��G�T�I [24]��G�|�I [25]��G���I" + outs("\033[31m �x \033[33m[23]��G�T�I [24]��G�|�I [25]��G���I" " [26]��G���I [34]��T�|�I\033[31m �x\033[m\n"); - prints("\033[31m �x \033[33m[35]��T���I [36]��T���I [45]��|���I" + outs("\033[31m �x \033[33m[35]��T���I [36]��T���I [45]��|���I" " [46]��|���I [56]�㤭���I\033[31m �x\033[m\n"); - prints("\033[31m �|�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w" + outs("\033[31m �|�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w" "�w�w�w�w�w�w�w�w�w�}\033[m\n"); } @@ -202,7 +202,7 @@ del(int value[100],int total, dicedata_t * table) if (money > table[i].mymoney) { move(22, 0); clrtoeol(); - prints("��������"); + outs("��������"); i--; continue; } @@ -238,86 +238,86 @@ show_output(int bet[]) /* �Ȯɭ��� �]�����Uclrtoline�ǩǪ� */ // XXX ���̩�? for (i = 13; i <= 18; i++) { move(i, 0); - prints(" "); + outs(" "); } move(12, 0); - prints("\033[1;31m �z�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w" + outs("\033[1;31m �z�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w" "�w�{\033[m\n\n\n\n\n\n"); - prints("\033[1;31m �|�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w" + outs("\033[1;31m �|�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w" "�w�}\033[m"); for (i = 0; i < 3; i++, j += 25) { switch (bet[i]) { case 1: move(13, j); - prints("\033[37m�~�w�w�w�w��\033[m"); + outs("\033[37m�~�w�w�w�w��\033[m"); move(14, j); - prints("\033[37m�x �x\033[m"); + outs("\033[37m�x �x\033[m"); move(15, j); - prints("\033[37m�x �� �x\033[m"); + outs("\033[37m�x �� �x\033[m"); move(16, j); - prints("\033[37m�x �x\033[m"); + outs("\033[37m�x �x\033[m"); move(17, j); - prints("\033[37m���w�w�w�w��\033[m"); + outs("\033[37m���w�w�w�w��\033[m"); break; case 2: move(13, j); - prints("\033[37m�~�w�w�w�w��\033[m"); + outs("\033[37m�~�w�w�w�w��\033[m"); move(14, j); - prints("\033[37m�x ���x\033[m"); + outs("\033[37m�x ���x\033[m"); move(15, j); - prints("\033[37m�x �x\033[m"); + outs("\033[37m�x �x\033[m"); move(16, j); - prints("\033[37m�x�� �x\033[m"); + outs("\033[37m�x�� �x\033[m"); move(17, j); - prints("\033[37m���w�w�w�w��\033[m"); + outs("\033[37m���w�w�w�w��\033[m"); break; case 3: move(13, j); - prints("\033[37m�~�w�w�w�w��\033[m"); + outs("\033[37m�~�w�w�w�w��\033[m"); move(14, j); - prints("\033[37m�x ���x\033[m"); + outs("\033[37m�x ���x\033[m"); move(15, j); - prints("\033[37m�x �� �x\033[m"); + outs("\033[37m�x �� �x\033[m"); move(16, j); - prints("\033[37m�x�� �x\033[m"); + outs("\033[37m�x�� �x\033[m"); move(17, j); - prints("\033[37m���w�w�w�w��\033[m"); + outs("\033[37m���w�w�w�w��\033[m"); break; case 4: move(13, j); - prints("\033[37m�~�w�w�w�w��\033[m"); + outs("\033[37m�~�w�w�w�w��\033[m"); move(14, j); - prints("\033[37m�x�� ���x\033[m"); + outs("\033[37m�x�� ���x\033[m"); move(15, j); - prints("\033[37m�x �x\033[m"); + outs("\033[37m�x �x\033[m"); move(16, j); - prints("\033[37m�x�� ���x\033[m"); + outs("\033[37m�x�� ���x\033[m"); move(17, j); - prints("\033[37m���w�w�w�w��\033[m"); + outs("\033[37m���w�w�w�w��\033[m"); break; case 5: move(13, j); - prints("\033[37m�~�w�w�w�w��\033[m"); + outs("\033[37m�~�w�w�w�w��\033[m"); move(14, j); - prints("\033[37m�x�� ���x\033[m"); + outs("\033[37m�x�� ���x\033[m"); move(15, j); - prints("\033[37m�x �� �x\033[m"); + outs("\033[37m�x �� �x\033[m"); move(16, j); - prints("\033[37m�x�� ���x\033[m"); + outs("\033[37m�x�� ���x\033[m"); move(17, j); - prints("\033[37m���w�w�w�w��\033[m"); + outs("\033[37m���w�w�w�w��\033[m"); break; case 6: move(13, j); - prints("\033[37m�~�w�w�w�w��\033[m"); + outs("\033[37m�~�w�w�w�w��\033[m"); move(14, j); - prints("\033[37m�x�� ���x\033[m"); + outs("\033[37m�x�� ���x\033[m"); move(15, j); - prints("\033[37m�x�� ���x\033[m"); + outs("\033[37m�x�� ���x\033[m"); move(16, j); - prints("\033[37m�x�� ���x\033[m"); + outs("\033[37m�x�� ���x\033[m"); move(17, j); - prints("\033[37m���w�w�w�w��\033[m"); + outs("\033[37m���w�w�w�w��\033[m"); break; } } @@ -338,7 +338,7 @@ dice_main(void) reload_money(); if (cuser.money < 10) { move(19, 0); - prints("\033[1;37m�W�L�Q���A�Ӫ��a~~\033[m"); + outs("\033[1;37m�W�L�Q���A�Ӫ��a~~\033[m"); pressanykey(); return 0; } @@ -369,7 +369,7 @@ dice_main(void) if (input[0] != 's' && input[0] != 'd' && cuser.money < 10) { move(21, 0); clrtoeol(); - prints("\033[1;37m�W�L�Q���~���~\033[m"); + outs("\033[1;37m�W�L�Q���~���~\033[m"); continue; } if (input[0] == 'd' || input[0] == 'D') { @@ -464,7 +464,7 @@ dice_main(void) } else { move(21, 0); clrtoeol(); - prints("\033[1;32m�u�i�� �U���A�ӸI�I�B��a\033[m"); + outs("\033[1;32m�u�i�� �U���A�ӸI�I�B��a\033[m"); } move(19, 0); diff --git a/mbbsd/edit.c b/mbbsd/edit.c index d8c7d80f..637b7736 100644 --- a/mbbsd/edit.c +++ b/mbbsd/edit.c @@ -256,7 +256,7 @@ ask(char *prompt) move(0, 0); clrtoeol(); standout(); - prints("%s", prompt); + outs(prompt); standend(); ch = igetch(); move(0, 0); @@ -836,8 +836,7 @@ write_header(FILE * fp) ifuseanony = 1; } else { if (!strcmp("r", real_name) || (!defanony && !real_name[0])) - snprintf(postlog.author, sizeof(postlog.author), - "%s", cuser.userid); + strlcpy(postlog.author, cuser.userid, sizeof(postlog.author)); else { snprintf(postlog.author, sizeof(postlog.author), "%s.", real_name); @@ -989,7 +988,7 @@ write_file(char *fpath, int saveheader, int *islocal) if (!HAS_PERM(PERM_LOGINOK)) { local_article = 1; move(2, 0); - prints("�z�|���q�L�����T�{�A�u�� Local Save�C\n"); + outs("�z�|���q�L�����T�{�A�u�� Local Save�C\n"); pressanykey(); } else local_article = 0; diff --git a/mbbsd/friend.c b/mbbsd/friend.c index 3826e379..d70a33da 100644 --- a/mbbsd/friend.c +++ b/mbbsd/friend.c @@ -423,7 +423,7 @@ friend_edit(int type) } fclose(fp); } - snprintf(genbuf, sizeof(genbuf), "%s", fpath); + strlcpy(genbuf, fpath, sizeof(genbuf)); if ((fp = fopen(genbuf, "r"))) { while (fgets(line, 80, fp)) { sscanf(line, "%s", uident); // XXX check buffer size @@ -443,7 +443,7 @@ friend_edit(int type) getdata_buf(2, 0, " �Ь����S�O�W����@��²�u�W��:", genbuf, 30, DOECHO); if ((fp = fopen(line, "w"))) { - fprintf(fp, "%s", genbuf); + fputs(genbuf, fp); fclose(fp); } } diff --git a/mbbsd/gamble.c b/mbbsd/gamble.c index 512df7f2..51fe99ef 100644 --- a/mbbsd/gamble.c +++ b/mbbsd/gamble.c @@ -45,7 +45,7 @@ show_ticket_data(char betname[MAX_ITEM][MAX_ITEM_LEN],char *direct, int *price, move(2, 0); snprintf(genbuf, sizeof(genbuf), "%s/" FN_TICKET_ITEMS, direct); if (!(fp = fopen(genbuf, "r"))) { - prints("\n�ثe�èS���|���L\n"); + outs("\n�ثe�èS���|���L\n"); snprintf(genbuf, sizeof(genbuf), "%s/" FN_TICKET_OUTCOME, direct); more(genbuf, NA); return 0; @@ -74,19 +74,19 @@ show_ticket_data(char betname[MAX_ITEM][MAX_ITEM_LEN],char *direct, int *price, } show_file(genbuf, 8, -1, NO_RELOAD); move(15, 0); - prints("\033[1;32m�ثe�U�`���p:\033[m\n"); + outs("\033[1;32m�ثe�U�`���p:\033[m\n"); total = load_ticket_record(direct, ticket); - prints("\033[33m"); + outs("\033[33m"); for (i = 0; i < count; i++) { prints("%d.%-8s: %-7d", i + 1, betname[i], ticket[i]); if (i == 3) - prints("\n"); + outc('\n'); } prints("\033[m\n\033[42m �U�`�`���B:\033[31m %d �� \033[m", total * (*price)); if (end) { - prints("\n��L�w�g����U�`\n"); + outs("\n��L�w�g����U�`\n"); return -count; } return count; @@ -206,7 +206,7 @@ openticket(int bid) if (fork()) { /* Ptt: �� fork() ������`�_�u�~�� */ move(22, 0); - prints("�t�αN��y��۰ʧ⤤�����G���G��ݪO �Y�ѥ[�̦h�|�ݭn�X�����ɶ�.."); + outs("�t�αN��y��۰ʧ⤤�����G���G��ݪO �Y�ѥ[�̦h�|�ݭn�X�����ɶ�.."); pressanykey(); unlockutmpmode(); return 0; @@ -246,7 +246,7 @@ openticket(int bid) fprintf(fp, "��L����\n"); while (fgets(buf, sizeof(buf), fp1)) { buf[sizeof(buf)-1] = 0; - fprintf(fp, "%s", buf); + fputs(buf, fp); } fprintf(fp, "�U�`���p\n"); diff --git a/mbbsd/guess.c b/mbbsd/guess.c index 9c2aba5f..ca80aa15 100644 --- a/mbbsd/guess.c +++ b/mbbsd/guess.c @@ -8,18 +8,18 @@ show_table(char TABLE[], char ifcomputer) int i; move(0, 35); - prints("\033[1;44;33m �i �q�Ʀr �j \033[m"); + outs("\033[1;44;33m �i �q�Ʀr �j \033[m"); move(8, 1); - prints("\033[1;44;36m�� �e �� �v\033[m\n"); - prints("\033[1;33m=================\033[m\n"); + outs("\033[1;44;36m�� �e �� �v\033[m\n"); + outs("\033[1;33m=================\033[m\n"); if (ifcomputer) { - prints("Ĺ�q��: 2 ��\n"); - prints("��q��: 0 ��\n"); + outs("Ĺ�q��: 2 ��\n"); + outs("��q��: 0 ��\n"); } else { for (i = 1; i <= 6; i++) prints("��%d��, %02d��\n", i, TABLE[i]); } - prints("\033[33m=================\033[m"); + outs("\033[33m=================\033[m"); } static long int @@ -234,7 +234,7 @@ guess_main() if (cuser.money < 5) { clear(); move(12, 35); - prints("�������� �ܤ֭n 5 Ptt$"); + outs("�������� �ܤ֭n 5 Ptt$"); unlockutmpmode(); pressanykey(); return 1; @@ -263,13 +263,13 @@ guess_main() yournum, sizeof(yournum), LCECHO); } while (!legal(atoi(yournum))); move(8, 25); - prints("�q���q"); + outs("�q���q"); flag = malloc(sizeof(char) * 10000); n = malloc(sizeof(int) * 1500); initcomputer(flag); } move(8, 55); - prints("�A�q"); + outs("�A�q"); while (((!computerwin || !youwin) && count < 10 && (ifcomputer[0])) || (!ifcomputer[0] && count < 10 && !youwin)) { if (!computerwin && ifcomputer[0]) { @@ -290,7 +290,7 @@ guess_main() free(n); if (ifcomputer[0]) { if (count > c_count) { - prints("�A�鵹�q���F"); + outs("�A�鵹�q���F"); move(18, 35); prints("�A�ߤF %lu ", money); if ((file = fopen(LOGPASS, "a"))) { @@ -303,7 +303,7 @@ guess_main() fclose(file); } } else if (count < c_count) { - prints("�u�F�`, ���A�Ȩ��o"); + outs("�u�F�`, ���A�Ȩ��o"); move(18, 35); prints("�A�Ȩ��F %lu ", money * 2); demoney(money * 2); @@ -328,21 +328,21 @@ guess_main() if (youwin) { demoney(TABLE[count] * money); if (count < 5) { - prints("�u�F�`, ���Q�A�Ȩ��F"); + outs("�u�F�`, ���Q�A�Ȩ��F"); if ((file = fopen(LOGPASS, "a"))) { fprintf(file, "id: %s, ��%d���q��, Ĺ�F %ld Ptt$\n", cuser.userid, count, TABLE[count] * money); fclose(file); } } else if (count > 5) { - prints("��, �Ӧh���~�q�X�ӤF"); + outs("��, �Ӧh���~�q�X�ӤF"); if ((file = fopen(LOGPASS, "a"))) { fprintf(file, "id: %s, ��%d���~�q��, �ߤF %ld Ptt$\n", cuser.userid, count, money); fclose(file); } } else { - prints("�����q�X��, �٧A�����a"); + outs("�����q�X��, �٧A�����a"); move(18, 35); clrtoeol(); prints("�A���^�F%lu Ptt$\n", money); @@ -359,7 +359,7 @@ guess_main() move(17, 35); prints("�K�K �зǵ��O %s ", answer); move(18, 35); - prints("�U���A�ӧa"); + outs("�U���A�ӧa"); if ((file = fopen(BBSHOME "/etc/loseguess.log", "a"))) { fprintf(file, "id: %s ��F %ld Ptt$\n", cuser.userid, money); fclose(file); diff --git a/mbbsd/kaede.c b/mbbsd/kaede.c index 9023557d..8df76a75 100644 --- a/mbbsd/kaede.c +++ b/mbbsd/kaede.c @@ -15,14 +15,15 @@ Ptt_prints(char *str, int mode) strbuf[w++] = str[r]; } else{ + /* Note, w will increased by copied length after */ switch( str[++r] ){ case 's': - w += snprintf(&strbuf[w], sizeof(strbuf) - w, - "%s", cuser.userid); + strlcpy(strbuf+w, cuser.userid, sizeof(strbuf)-w); + w += strlen(strbuf+w); break; case 't': - w += snprintf(&strbuf[w], sizeof(strbuf) - w, - "%s", Cdate(&now)); + strlcpy(strbuf+w, Cdate(&now), sizeof(strbuf)-w); + w += strlen(strbuf+w); break; case 'u': w += snprintf(&strbuf[w], sizeof(strbuf) - w, @@ -41,8 +42,8 @@ Ptt_prints(char *str, int mode) "%d", cuser.numposts); break; case 'n': - w += snprintf(&strbuf[w], sizeof(strbuf) - w, - "%s", cuser.username); + strlcpy(strbuf+w, cuser.username, sizeof(strbuf)-w); + w += strlen(strbuf+w); break; case 'm': w += snprintf(&strbuf[w], sizeof(strbuf) - w, diff --git a/mbbsd/lovepaper.c b/mbbsd/lovepaper.c index 826f6eb4..e8a15769 100644 --- a/mbbsd/lovepaper.c +++ b/mbbsd/lovepaper.c @@ -69,7 +69,7 @@ x_love() y = y - 1; else { if (tline > 0) { - fprintf(fpo, "%s", buf1); + fputs(buf1, fpo); tline--; } } @@ -77,7 +77,7 @@ x_love() if (buf1[0] == '$') y--; else if (y == 0) - fprintf(fpo, "%s", buf1); + fputs(buf1, fpo); } } diff --git a/mbbsd/mail.c b/mbbsd/mail.c index cf353893..81d20d70 100644 --- a/mbbsd/mail.c +++ b/mbbsd/mail.c @@ -24,7 +24,7 @@ setforward() getdata(b_lines, 0, "�T�w�}�Ҧ۰���H�\\��?(Y/n)", yn, sizeof(yn), LCECHO); if (yn[0] != 'n' && (fp = fopen(buf, "w"))) { - fprintf(fp, "%s", ip); + fputs(ip, fp); fclose(fp); vmsg("�]�w����!"); return 0; @@ -54,7 +54,7 @@ built_mail_index() BBSHOME "/bin/buildir " BBSHOME "/home/%c/%s", cuser.userid[0], cuser.userid); move(22, 0); - prints("\033[1;31m�w�g�B�z����!! �Ѧh���K �q�Э��~\033[m"); + outs("\033[1;31m�w�g�B�z����!! �Ѧh���K �q�Э��~\033[m"); pressanykey(); system(genbuf); return 0; @@ -333,7 +333,7 @@ multi_list(int *reciper) stand_title("�s�ձH�H�W��"); ShowNameList(3, 0, msg_cc); move(1, 0); - prints("(I)�ޤJ�n�� (O)�ޤJ�W�u�q�� (N)�ޤJ�s�峹�q�� (0-9)�ޤJ��L�S�O�W��"); + outs("(I)�ޤJ�n�� (O)�ޤJ�W�u�q�� (N)�ޤJ�s�峹�q�� (0-9)�ޤJ��L�S�O�W��"); getdata(2, 0, "(A)�W�[ (D)�R�� (M)�T�{�H�H�W�� (Q)���� �H[M]", genbuf, 4, LCECHO); @@ -609,9 +609,7 @@ mail_all() sethomedir(genbuf, userid); if (append_record_forward(genbuf, &mymail, sizeof(mymail)) == -1) outs(err_uid); - snprintf(genbuf, sizeof(genbuf), - "%*s %5d / %5d", IDLEN + 1, userid, i + 1, unum); - vmsg(genbuf); + vmsg("%*s %5d / %5d", IDLEN + 1, userid, i + 1, unum); } } return 0; diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c index d8f00251..897d6d13 100644 --- a/mbbsd/mbbsd.c +++ b/mbbsd/mbbsd.c @@ -807,7 +807,7 @@ inline static void check_bad_login(void) { setuserfile(genbuf, str_badlogin); if (more(genbuf, NA) != -1) { move(b_lines - 3, 0); - prints("�q�`�èS����k���D��ip�O�֩Ҧ�, " + outs("�q�`�èS����k���D��ip�O�֩Ҧ�, " "�H�Ψ�N��(�O���p�߫����Φ��N���z�K�X)\n" "�Y�z���b���Q�s�κü{, �иg�`���z���K�X�ΨϥΥ[�K�s�u"); if (getans("�z�n�R���H�W���~���ժ��O����(Y/N)?[Y]") != 'n') diff --git a/mbbsd/menu.c b/mbbsd/menu.c index ec6b1418..2040e35d 100644 --- a/mbbsd/menu.c +++ b/mbbsd/menu.c @@ -64,9 +64,8 @@ showtitle(char *title, char *mid) } } if (board_hidden_status) - prints("\033[32m%s", currboard); - else - prints("%s", currboard); + outs("\033[32m"); + outs(currboard); prints("\033[3%dm�n\033[0m\n", currmode & MODE_SELECT ? 6 : currmode & MODE_DIGEST ? 2 : 7); } diff --git a/mbbsd/othello.c b/mbbsd/othello.c index 0eac4441..7f4b77b2 100644 --- a/mbbsd/othello.c +++ b/mbbsd/othello.c @@ -67,9 +67,9 @@ print_chess(int x, int y, char chess) { move(STARTX - 1 + x * 2, STARTY - 2 + y * 4); if (chess != HINT || if_hint == 1) - prints(CHESS_TYPE[(int)chess]); + outs(CHESS_TYPE[(int)chess]); else - prints(CHESS_TYPE[NONE]); + outs(CHESS_TYPE[NONE]); refresh(); } @@ -79,17 +79,17 @@ printboard() int i; move(STARTX, STARTY); - prints("�z�w�s�w�s�w�s�w�s�w�s�w�s�w�s�w�{"); + outs("�z�w�s�w�s�w�s�w�s�w�s�w�s�w�s�w�{"); for (i = 0; i < 7; i++) { move(STARTX + 1 + i * 2, STARTY); - prints("�x �x �x �x �x �x �x �x �x"); + outs("�x �x �x �x �x �x �x �x �x"); move(STARTX + 2 + i * 2, STARTY); - prints("�u�w�q�w�q�w�q�w�q�w�q�w�q�w�q�w�t"); + outs("�u�w�q�w�q�w�q�w�q�w�q�w�q�w�q�w�t"); } move(STARTX + 1 + i * 2, STARTY); - prints("�x �x �x �x �x �x �x �x �x"); + outs("�x �x �x �x �x �x �x �x �x"); move(STARTX + 2 + i * 2, STARTY); - prints("�|�w�r�w�r�w�r�w�r�w�r�w�r�w�r�w�}"); + outs("�|�w�r�w�r�w�r�w�r�w�r�w�r�w�r�w�}"); print_chess(4, 4, WHITE); print_chess(5, 5, WHITE); print_chess(4, 5, BLACK); @@ -97,25 +97,25 @@ printboard() move(3, 56); prints("(��)%s", cuser.userid); move(3, 72); - prints(": 02"); + outs(": 02"); move(4, 56); - prints("(��)�q�� : 02"); + outs("(��)�q�� : 02"); move(6, 56); - prints("�� �i�H�U���B"); + outs("�� �i�H�U���B"); move(7, 56); - prints("[q] �h�X"); + outs("[q] �h�X"); move(8, 56); - prints("[h] �}��/���� ����"); + outs("[h] �}��/���� ����"); move(9, 56); - prints("[Enter][Space] �U��"); + outs("[Enter][Space] �U��"); move(10, 56); - prints("�W:��, i"); + outs("�W:��, i"); move(11, 56); - prints("�U:��, k"); + outs("�U:��, k"); move(12, 56); - prints("��:��, j"); + outs("��:��, j"); move(13, 56); - prints("�k:��, l"); + outs("�k:��, l"); } static int @@ -222,7 +222,7 @@ end_of_game(int quit) char *opponent[] = {"", "CD-65", "", "����", "�p��", "", "�j�H", "�M�a"}; move(STARTX - 1, 30); - prints(" "); + outs(" "); move(22, 35); fp = fopen(LOGFILE, "a"); if (!quit) { @@ -266,7 +266,7 @@ end_of_game(int quit) number[0], cuser.userid, number[1] - number[0]); } } else { - prints("�A�M�q����������!!"); + outs("�A�M�q����������!!"); if (fp) fprintf(fp, "�b%s�Ť�, %s�M�q���H %02d:%02d �����F����\n", opponent[think], cuser.userid, number[1], number[0]); @@ -347,10 +347,10 @@ player(char color) pass++; if (pass == 1) { move(23, 34); - prints("�A���ݩ��o�@�B!!"); + outs("�A���ݩ��o�@�B!!"); igetch(); move(28, 23); - prints(" "); + outs(" "); } else { end_of_game(0); return false; @@ -394,7 +394,7 @@ report() else if (nowboard[i][j] == WHITE) number[1]++; move(3, 60); - prints("%s", cuser.userid); + outs(cuser.userid); move(3, 72); prints(": %02d", number[0]); move(4, 60); @@ -477,17 +477,17 @@ Computer(int thinkstep, int table) nowy = maxj; } else { move(23, 30); - prints("�q�����o�@�B��!!"); + outs("�q�����o�@�B��!!"); pass++; if (pass == 2) { move(23, 24); - prints(" "); + outs(" "); end_of_game(0); return false; } igetch(); move(23, 24); - prints(" "); + outs(" "); } return true; } @@ -498,11 +498,11 @@ choose() char thinkstep[2]; move(2, 0); - prints("�п������:"); + outs("�п������:"); move(5, 0); - prints("(1) CD-65\n"); /* �Q 1 �B */ - prints("(2) ����\n"); /* �Q 3 �B */ - prints("(3) �p��\n"); /* �Q 4 �B */ + outs("(1) CD-65\n"); /* �Q 1 �B */ + outs("(2) ����\n"); /* �Q 3 �B */ + outs("(3) �p��\n"); /* �Q 4 �B */ do { getdata(4, 0, "�п�ܤ@�ӹ�H�M�z�若:(1~5)", thinkstep, sizeof(thinkstep), LCECHO); @@ -536,7 +536,7 @@ othello_main() which_table = rand() % NR_TABLE; while (true) { move(STARTX - 1, 30); - prints("����A�U�F..."); + outs("����A�U�F..."); if (!player(BLACK)) break; report(); @@ -546,7 +546,7 @@ othello_main() break; } move(STARTX - 1, 30); - prints("�q����Ҥ�..."); + outs("�q����Ҥ�..."); refresh(); if (!Computer(think, which_table)) break; diff --git a/mbbsd/page.c b/mbbsd/page.c index ce6e6ea8..25d43eac 100644 --- a/mbbsd/page.c +++ b/mbbsd/page.c @@ -1,7 +1,7 @@ /* $Id$ */ #include "bbs.h" -#define hpressanykey(a) {move(22, 0); prints(a); pressanykey();} +#define hpressanykey(a) {move(22, 0); outs(a); pressanykey();} #define TITLE "\033[1;37;45m �����d�ߨt�� \033[1;44;33m��@��:Heat\033[m" static void @@ -16,7 +16,7 @@ print_station(const char * const addr[6][100], int path, int *line, int *num) prints(" %2d.%-6s", (*num)+1, addr[path - 1][*num]); (*num)++; } - outs("\n"); + outc('\n'); (*line)++; }while(i==7); } @@ -79,7 +79,7 @@ main_railway() setutmpmode(RAIL_WAY); clear(); move(0, 25); - prints(TITLE); + outs(TITLE); move(1, 0); getdata(3, 0, "\033[1;35m�A�T�w�n�j�M��?[y/n]:\033[m", buf, 2, LCECHO); @@ -94,7 +94,7 @@ main_railway() clear(); move(0, 25); - prints(TITLE); + outs(TITLE); line = 3; print_station(addr, path, &line, &station_num); sprintf(genbuf, "\033[1;35m�п�J�_��(1-%d):\033[m", station_num); diff --git a/mbbsd/read.c b/mbbsd/read.c index 2ead1834..53bc09ba 100644 --- a/mbbsd/read.c +++ b/mbbsd/read.c @@ -89,12 +89,10 @@ EnumTagFhdr(fileheader_t * fhdr, char *direct, int locus) int AskTag(char *msg) { - char buf[80]; int num; num = TagNum; - snprintf(buf, sizeof(buf), "�� %s A)�峹 T)�аO Q)uit?", msg); - switch (getans(buf)) { + switch (getans("�� %s A)�峹 T)�аO Q)uit?", msg)) { case 'q': num = -1; break; diff --git a/mbbsd/register.c b/mbbsd/register.c index 10e995c8..64b0afe5 100644 --- a/mbbsd/register.c +++ b/mbbsd/register.c @@ -328,7 +328,7 @@ check_register() /* �^�йL�����{�ҫH��A�δ��g E-mail post �L */ clear(); move(9, 3); - prints("�иԶ�g\033[32m���U�ӽг�\033[m�A" + outs("�иԶ�g\033[32m���U�ӽг�\033[m�A" "�q�i�����H��o�i���ϥ��v�O�C\n\n\n\n"); u_register(); diff --git a/mbbsd/screen.c b/mbbsd/screen.c index 22838b98..a9089f4e 100644 --- a/mbbsd/screen.c +++ b/mbbsd/screen.c @@ -430,7 +430,7 @@ outmsg(char *msg) { move(b_lines, 0); clrtoeol(); - prints(msg); + outs(msg); } void @@ -450,7 +450,7 @@ mouts(int y, int x, char *str) { move(y, x); clrtoeol(); - prints("%s",str); + outs(str); } void diff --git a/mbbsd/stuff.c b/mbbsd/stuff.c index ed671596..4d5a1a8f 100644 --- a/mbbsd/stuff.c +++ b/mbbsd/stuff.c @@ -327,7 +327,7 @@ gettime(int line, time_t dt, char*head) memcpy(&endtime, ptime, sizeof(struct tm)); snprintf(yn, sizeof(yn), "%4d", ptime->tm_year + 1900); - move(line, 0); prints("%s",head); + move(line, 0); outs(head); i=strlen(head); do { getdata_buf(line, i, " �褸�~:", yn, 5, LCECHO); diff --git a/mbbsd/syspost.c b/mbbsd/syspost.c index 39ccf97e..284e5fb4 100644 --- a/mbbsd/syspost.c +++ b/mbbsd/syspost.c @@ -21,7 +21,7 @@ post_msg(char *bname, char *title, char *msg, char *author) fprintf(fp, "�ɶ�: %s\n", ctime(&now)); /* �峹�����e */ - fprintf(fp, "%s", msg); + fputs(msg, fp); fclose(fp); /* �N�ɮץ[�J�C�� */ diff --git a/mbbsd/talk.c b/mbbsd/talk.c index 7d5400ab..69262ac5 100644 --- a/mbbsd/talk.c +++ b/mbbsd/talk.c @@ -396,7 +396,7 @@ my_query(char *uident) money[i]); if (uentp && ((fri_stat & HFM && !uentp->invisible) || strcmp(muser.userid,cuser.userid) == 0)) prints(" ($%d)", muser.money); - prints("\n"); + outc('\n'); prints("�m�W�����ơn%d��", muser.numlogins); move(2, 40); @@ -443,35 +443,35 @@ water_scr(water_t * tw, int which, char type) int i; int colors[] = {33, 37, 33, 37, 33}; move(8 + which, 28); - prints(" "); + outc(' '); move(8 + which, 28); prints("\033[1;37;45m %c %-14s \033[0m", tw->uin ? ' ' : 'x', tw->userid); for (i = 0; i < 5; ++i) { move(16 + i, 4); - prints(" "); + outc(' '); move(16 + i, 4); if (tw->msg[(tw->top - i + 4) % 5].last_call_in[0] != 0) prints("\033[0m \033[1;%d;44m��%-64s\033[0m \n", colors[i], tw->msg[(tw->top - i + 4) % 5].last_call_in); else - prints("\033[0m�@\n"); + outs("\033[0m�@\n"); } move(21, 4); - prints(" "); + outc(' '); move(21, 4); prints("\033[0m \033[1;37;46m%-66s\033[0m \n", tw->msg[5].last_call_in); move(0, 0); - prints(" "); + outc(' '); move(0, 0); #ifdef PLAY_ANGEL if (tw->msg[0].msgmode == MSGMODE_TOANGEL) - prints("\033[0m�^���p�D�H:"); + outs("\033[0m�^���p�D�H:"); else #endif prints("\033[0m���� %s:", tw->userid); @@ -479,7 +479,7 @@ water_scr(water_t * tw, int which, char type) move(0, strlen(tw->userid) + 6); } else { move(8 + which, 28); - prints("123456789012345678901234567890"); + outs("123456789012345678901234567890"); move(8 + which, 28); prints("\033[1;37;44m %c %-13s�@\033[0m", tw->uin ? ' ' : 'x', @@ -507,7 +507,7 @@ my_write2(void) //init screen move(7, 28); - prints("\033[1;33;46m �� ���y������H ��\033[0m"); + outs("\033[1;33;46m �� ���y������H ��\033[0m"); for (i = 0; i < 5; ++i) if (swater[i] == NULL || swater[i]->pid == 0) break; @@ -519,10 +519,10 @@ my_write2(void) water_scr(swater[i], i, 0); } move(15, 4); - prints("\033[0m \033[1;35m��\033[1;36m�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w" + outs("\033[0m \033[1;35m��\033[1;36m�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w" "�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w\033[1;35m��\033[0m "); move(22, 4); - prints(" \033[1;35m��\033[1;36m�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w" + outs(" \033[1;35m��\033[1;36m�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w" "�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w\033[1;35m��\033[0m "); water_scr(swater[0], 0, 1); refresh(); @@ -566,7 +566,7 @@ my_write2(void) } else msg[0] = 0; move(0, 0); - prints("\033[m"); + outs("\033[m"); clrtoeol(); #ifndef PLAY_ANGEL snprintf(genbuf, sizeof(genbuf), "���� %s:", tw->userid); @@ -878,7 +878,7 @@ t_display_new(void) !swater[i - 1]->uin ? '#' : ' ', swater[i - 1]->userid); } else - prints(" "); + outs(" "); else prints("%s ���� \033[m", water_which == &water[0] ? "\033[1;33;47m " : @@ -911,7 +911,7 @@ t_display_new(void) if (t_last_write[0]) { move(i + off, 0); clrtoeol(); - prints(t_last_write); + outs(t_last_write); i++; } move(i + off, 0); @@ -1202,7 +1202,7 @@ do_talk(int fd) if (send(fd, data, 1, 0) != 1) break; if (log) - fprintf(log, "%c", (ch == Ctrl('M')) ? '\n' : (char)*data); + fputc((ch == Ctrl('M')) ? '\n' : (char)*data, log); do_talk_char(&mywin, *data, flog); } } @@ -1879,12 +1879,12 @@ draw_pickup(int drawall, pickup_t * pickup, int pickup_way, myfriend, friendme, currutmp->brc_id ? (bfriend + 1) : 0, badfriend); for (i = 0, ch = page * nPickups + 1; i < nPickups; ++i, ++ch) { move(i + 3, 0); - prints("a"); + outc('a'); move(i + 3, 0); uentp = pickup[i].ui; friend = pickup[i].friend; if (uentp == NULL) { - prints("\n"); + outc('\n'); continue; } if (!uentp->pid) { @@ -2741,7 +2741,7 @@ talkreply(void) clear(); - prints("\n\n"); + outs("\n\n"); prints(" (Y) ���ڭ� %s �a�I" " (A) �ڲ{�b�ܦ��A�е��@�|��A call ��\n", sig_des[sig]); prints(" (N) �ڲ{�b���Q %s" diff --git a/mbbsd/user.c b/mbbsd/user.c index b8f1dc44..19cc6d90 100644 --- a/mbbsd/user.c +++ b/mbbsd/user.c @@ -39,7 +39,7 @@ u_loginview() else { pbits ^= (1 << i); move(i + 4, 28); - prints((pbits >> i) & 1 ? "��" : "��"); + outs((pbits >> i) & 1 ? "��" : "��"); } } @@ -174,8 +174,8 @@ violate_law(userec_t * u, int unum) move(1, 0); clrtobot(); 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"); + outs("(1)Cross-post (2)�õo�s�i�H (3)�õo�s��H\n"); + outs("(4)���Z���W�ϥΪ� (8)��L�H�@��B�m�欰\n(9)�� id �欰\n"); getdata(5, 0, "(0)����", ans, 3, DOECHO); switch (ans[0]) { case '1': @@ -233,7 +233,7 @@ static void Customize(void) mindbuf[4] = 0; while( !done ){ move(2, 0); - prints("�z�ثe���ӤH�Ƴ]�w: "); + outs("�z�ثe���ӤH�Ƴ]�w: "); move(4, 0); prints("%-30s%10s\n", "A. ���y�Ҧ�", wm[(cuser.uflag2 & WATER_MASK)]); @@ -945,7 +945,7 @@ ispersonalid(char *inid) static char * getregcode(char *buf) { - sprintf(buf, "%s", crypt(cuser.userid, "02")); + strcpy(buf, crypt(cuser.userid, "02")); return buf; } @@ -1033,7 +1033,7 @@ toregister(char *email, char *genbuf, char *phone, char *career, break; } else { move(17, 0); - prints("���w��������X���X�k," + outs("���w��������X���X�k," "�Y�z�L��������п�ܨ�L�覡�{��"); } @@ -1047,7 +1047,7 @@ toregister(char *email, char *genbuf, char *phone, char *career, break; } else { move(17, 0); - prints("���w�� E-Mail ���X�k," + outs("���w�� E-Mail ���X�k," "�Y�z�L E-Mail �п�J x�ѯ�����ʻ{��"); } } @@ -1307,7 +1307,7 @@ u_register(void) if(cuser.uflag2 & FOREIGN) mail_muser(cuser, "[�X�J�Һz��]", "etc/foreign_welcome"); cuser.userlevel |= (PERM_LOGINOK | PERM_POST); - prints("\n���U���\\, ���s�W����N���o�����v��\n" + outs("\n���U���\\, ���s�W����N���o�����v��\n" "�Ы��U���@������᭫�s�W��~ :)"); sethomefile(genbuf, cuser.userid, "justify.wait"); unlink(genbuf); @@ -1367,7 +1367,7 @@ u_register(void) while( 1 ){ getfield(4, "0123456789","�����Ҹ� �@�Ӹ��X �� SSN", ident, 11); move(6, 2); - prints("���X���~�̱N�L�k���o�i�@�B���v���I"); + outs("���X���~�̱N�L�k���o�i�@�B���v���I"); getdata(7, 2, "�O�_�T�w(Y/N)", ans, 3, LCECHO); if (ans[0] == 'y' || ans[0] == 'Y') break; @@ -1397,7 +1397,7 @@ u_register(void) } move(11, 0); - prints(" �ɶq�ԲӪ���g�z���A�ȳ��, �j�M�|�սг·�" + outs(" �ɶq�ԲӪ���g�z���A�ȳ��, �j�M�|�սг·�" " �[\033[1;33m�t��\033[m, ���q���Х[¾��\n" ); while (1) { @@ -1487,7 +1487,7 @@ u_register(void) clear(); move(9, 3); - prints("�̫�Post�@�g\033[32m�ۧڤ��Ф峹\033[m���j�a�a�A" + outs("�̫�Post�@�g\033[32m�ۧڤ��Ф峹\033[m���j�a�a�A" "�i�D�Ҧ��Ѱ��Y\033[31m�ڨӰ�^$�C\\n\n\n\n"); pressanykey(); cuser.userlevel |= PERM_POST; diff --git a/mbbsd/vice.c b/mbbsd/vice.c index e774479c..fc8e9044 100644 --- a/mbbsd/vice.c +++ b/mbbsd/vice.c @@ -1,4 +1,4 @@ -/* $Id: vice.c,v 1.9 2003/06/28 08:49:26 kcwu Exp $ */ +/* $Id$ */ #include "bbs.h" #define VICE_PLAY BBSHOME "/etc/vice/vice.play" @@ -63,7 +63,7 @@ ran_showfile(int y, int x, char *filename, int maxnum) move(y, x); while (fgets(buf, sizeof(buf), fs)) - prints("%s", buf); + outs(buf); fclose(fs); return 1; @@ -106,7 +106,7 @@ vice_main() i = 0; move(10, 24); clrtoeol(); - prints("�o�@�����o�����X"); + outs("�o�@�����o�����X"); while (fgets(serial, 15, fd)) { if ((ptr = strchr(serial, '\r'))) *ptr = 0; @@ -115,7 +115,7 @@ vice_main() if( i >= 14 ) break; move(10 + i, 24 + j); - prints("%s", serial); + outs(serial); j += 9; j %= 45; } diff --git a/mbbsd/vote.c b/mbbsd/vote.c index 2af7495f..0338427b 100644 --- a/mbbsd/vote.c +++ b/mbbsd/vote.c @@ -66,7 +66,7 @@ convert_to_newversion(FILE *fp, char *file, char *ballots) } fprintf(fpw, "000,000\n"); while (fgets(buf, sizeof(buf), fp)) { - fprintf(fpw, "%s", buf); + fputs(buf, fpw); count++; } rewind(fpw); @@ -708,10 +708,10 @@ vote_maintain(char *bname) strlcpy(inbuf, "�����W��", sizeof(inbuf)); fp = fopen(buf, "w"); assert(fp); - fprintf(fp, "%s", inbuf); + fputs(inbuf, fp); fclose(fp); - prints("��������}�l�s�覹�� [�벼�v��]"); + outs("��������}�l�s�覹�� [�벼�v��]"); pressanykey(); setbfile(buf, bname, STR_new_desc); aborted = vedit(buf, NA, NULL); @@ -758,9 +758,8 @@ vote_maintain(char *bname) while (!aborted) { if( num % 15 == 0 ){ for( i = num ; i < num + 15 ; ++i ){ - snprintf(buf, sizeof(buf), "\033[1;30m%c)\033[m ", i + 'A'); move((i % 15) + 2, (i / 15) * 40); - prints(buf); + prints("\033[1;30m%c)\033[m ", i + 'A'); } } snprintf(buf, sizeof(buf), "%c) ", num + 'A'); @@ -977,7 +976,7 @@ user_vote_one(char *bname, int ind) continue; else if ( CURRENT_CHOICE ) { /* �w�� */ move(((vote[0] - 'A') % 15) + 5, (((vote[0] - 'A')) / 15) * 40); - prints(" "); + outc(' '); CURRENT_CHOICE = 0; i--; continue; @@ -985,14 +984,14 @@ user_vote_one(char *bname, int ind) if (i == tickets) continue; move(((vote[0] - 'A') % 15) + 5, (((vote[0] - 'A')) / 15) * 40); - prints("*"); + outc('*'); CURRENT_CHOICE = 1; i++; continue; } if (vote_flag(bname, ind, vote[0]) != 0) - prints("���Ƨ벼! �����p���C"); + outs("���Ƨ벼! �����p���C"); else { setbfile(buf, bname, STR_new_ballots); if ((fd = open(buf, O_WRONLY | O_CREAT | O_APPEND, 0600)) == 0) @@ -1044,7 +1043,7 @@ user_vote_one(char *bname, int ind) } } move(b_lines - 1, 0); - prints("�w�����벼�I\n"); + outs("�w�����벼�I\n"); } } break; @@ -1087,7 +1086,7 @@ user_vote(char *bname) setbfile(buf, bname, STR_new_control); move(0, 0); if ((fp = fopen(buf, "r"))) { - prints("(0) "); + outs("(0) "); x = 0; fclose(fp); diff --git a/mbbsd/voteboard.c b/mbbsd/voteboard.c index 3890df2a..84a50032 100644 --- a/mbbsd/voteboard.c +++ b/mbbsd/voteboard.c @@ -22,7 +22,7 @@ do_voteboardreply(fileheader_t * fhdr) clear(); if (!CheckPostPerm()) { move(5, 10); - prints("�藍�_�A�z�ثe�L�k�b���o���峹�I"); + outs("�藍�_�A�z�ثe�L�k�b���o���峹�I"); pressanykey(); return; } @@ -46,14 +46,14 @@ do_voteboardreply(fileheader_t * fhdr) else yes++; } - if (yes>3) prints(genbuf); + if (yes>3) outs(genbuf); if (!strncmp(genbuf, "�s�p�����ɶ�", 12)) { ptr = strchr(genbuf, '('); assert(ptr); sscanf(ptr + 1, "%ld", &endtime); if (endtime < now) { - prints("�s�p�ɶ��w�L"); + outs("�s�p�ɶ��w�L"); pressanykey(); fclose(fi); return; @@ -64,7 +64,7 @@ do_voteboardreply(fileheader_t * fhdr) strtok(genbuf+4," \n"); if (!strncmp(genbuf + 4, cuser.userid, IDLEN)) { move(5, 10); - prints("�z�w�g�s�p�L���g�F"); + outs("�z�w�g�s�p�L���g�F"); getdata(17, 0, "�n�ק�z���e���s�p�ܡH(Y/N) [N]", opnion, 3, LCECHO); if (opnion[0] != 'y') { fclose(fi); @@ -103,14 +103,14 @@ do_voteboardreply(fileheader_t * fhdr) while (fgets(genbuf, sizeof(genbuf), fi)) { if (!strncmp("----------", genbuf, 10)) break; - fprintf(fo, "%s", genbuf); + fputs(genbuf, fo); } if (!endtime) { now += 14 * 24 * 60 * 60; fprintf(fo, "�s�p�����ɶ�: (%ld)%s", now, ctime(&now)); now -= 14 * 24 * 60 * 60; } - fprintf(fo, "%s", genbuf); + fputs(genbuf, fo); len = strlen(cuser.userid); for(yes=0; fgets(genbuf, sizeof(genbuf), fi);) { if (!strncmp("----------", genbuf, 10)) @@ -121,7 +121,7 @@ do_voteboardreply(fileheader_t * fhdr) } if (opnion[0] == 'y') fprintf(fo, "%3d.%-15s%-34s �ӷ�:%s\n", ++yes, cuser.userid, reason, cuser.lasthost); - fprintf(fo, "%s", genbuf); + fputs(genbuf, fo); for(no=0; fgets(genbuf, sizeof(genbuf), fi);) { if (!strncmp("----------", genbuf, 10)) @@ -159,20 +159,20 @@ do_voteboard(int type) clear(); if (!CheckPostPerm()) { move(5, 10); - prints("�藍�_�A�z�ثe�L�k�b���o���峹�I"); + outs("�藍�_�A�z�ثe�L�k�b���o���峹�I"); pressanykey(); return FULLUPDATE; } move(0, 0); clrtobot(); - prints("�z���b�ϥ� PTT ���s�p�t��\n"); - prints("���s�p�t�αN�߰ݱz�@�ǰ��D�A�Фp�ߦ^���~��}�l�s�p\n"); - prints("���N���X�s�p�ת̡A�N�Q�C�J�����w��ϥΪ̳�\n"); + outs("�z���b�ϥ� PTT ���s�p�t��\n"); + outs("���s�p�t�αN�߰ݱz�@�ǰ��D�A�Фp�ߦ^���~��}�l�s�p\n"); + outs("���N���X�s�p�ת̡A�N�Q�C�J�����w��ϥΪ̳�\n"); move(4, 0); clrtobot(); - prints("(1)���ʳs�p (2)�O�W���� "); + outs("(1)���ʳs�p (2)�O�W���� "); if(type==0) - prints("(3)�ӽзs�O (4)�o���ªO (5)�s�p�O�D \n(6)�}�K�O�D (7)�s�p�p�ժ� (8)�}�K�p�ժ� (9)�ӽзs�s��\n"); + outs("(3)�ӽзs�O (4)�o���ªO (5)�s�p�O�D \n(6)�}�K�O�D (7)�s�p�p�ժ� (8)�}�K�p�ժ� (9)�ӽзs�s��\n"); do { getdata(6, 0, "�п�J�s�p���O [0:����]�G", topic, 3, DOECHO); |