From 7844305800a7a4781ac46777d429dbe667327911 Mon Sep 17 00:00:00 2001 From: kcwu Date: Thu, 10 Jun 2004 07:08:55 +0000 Subject: 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 --- mbbsd/card.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'mbbsd/card.c') 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("│\033[1;33;42m※※※※\033[m│"); + outs("│\033[1;33;42m※※※※\033[m│"); else switch (cline) { case 1: - prints("╭────╮"); + outs("╭────╮"); break; case 2: prints("│\033[1;%dm%s\033[m │", color, cn[number - 1]); @@ -127,7 +127,7 @@ card_display(int cline, int number, int flower, int show) prints("│ \033[1;%dm%s\033[m│", color, cn[number - 1]); break; case 8: - prints("╰────╯"); + outs("╰────╯"); break; } } @@ -176,12 +176,12 @@ card_start(char name[]) clear(); stand_title(name); move(1, 0); - prints(" \033[1;33;41m 電 腦 \033[m"); + outs(" \033[1;33;41m 電 腦 \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 自 己 \033[m"); + outs(" \033[1;37;42m 自 己 \033[m"); } static int @@ -283,7 +283,7 @@ card_99() move(21, 0); clrtoeol(); prints("[0]目前 %d , 殘 %d 點\n", count, 99 - count); - prints("左右鍵移動游標, [Enter]確定, [ + ]表加二十(加十), [Q/q]放棄遊戲"); + outs("左右鍵移動游標, [Enter]確定, [ + ]表加二十(加十), [Q/q]放棄遊戲"); while (1) { i = card_select(&j); if (i == 0) /* 放棄遊戲 */ -- cgit v1.2.3