diff options
author | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-06-10 15:08:55 +0800 |
---|---|---|
committer | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-06-10 15:08:55 +0800 |
commit | 7844305800a7a4781ac46777d429dbe667327911 (patch) | |
tree | 28e429be86f0ecc20cb7d30d95d054b420f09bc9 /mbbsd | |
parent | 3b109adbea257408835589c45e0125f77064274c (diff) | |
download | pttbbs-7844305800a7a4781ac46777d429dbe667327911.tar pttbbs-7844305800a7a4781ac46777d429dbe667327911.tar.gz pttbbs-7844305800a7a4781ac46777d429dbe667327911.tar.bz2 pttbbs-7844305800a7a4781ac46777d429dbe667327911.tar.lz pttbbs-7844305800a7a4781ac46777d429dbe667327911.tar.xz pttbbs-7844305800a7a4781ac46777d429dbe667327911.tar.zst pttbbs-7844305800a7a4781ac46777d429dbe667327911.zip |
replace some prints() with outs(),
replace some outs() with outc(),
replace some fprintf() with fputs(),
and so on.
for performance.
and don't treat user input as format string.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2055 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
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("½Ð¿ï¾Ü±zn°õ¦æªº«§@:\n" + outs("½Ð¿ï¾Ü±zn°õ¦æªº«§@:\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("±zn§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©wn·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); |