From ec016da9008a32c5ea9f132fa39f695e4891fc3e Mon Sep 17 00:00:00 2001 From: kcwu Date: Sun, 17 Oct 2004 19:28:15 +0000 Subject: rename global static variable "fp" to "chessfp" git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2263 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/chc.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'mbbsd') diff --git a/mbbsd/chc.c b/mbbsd/chc.c index 54f58ea6..abc8a005 100644 --- a/mbbsd/chc.c +++ b/mbbsd/chc.c @@ -18,8 +18,8 @@ static int chc_my, chc_turn, chc_selected, chc_firststep; static char chc_mode; static char chc_warnmsg[64]; static char chc_ipass = 0, chc_hepass = 0; -/* fp is for logging the step */ -static FILE *fp = NULL; +/* chessfp is for logging the step */ +static FILE *chessfp = NULL; static board_t *chc_bp; static chc_act_list *act_list = NULL; @@ -286,25 +286,25 @@ int chc_log_open(chcusr_t *user1, chcusr_t *user2, char *file) { char buf[128]; - if ((fp = fopen(file, "w")) == NULL) + if ((chessfp = fopen(file, "w")) == NULL) return -1; sprintf(buf, "%s V.S. %s\n", user1->userid, user2->userid); - fputs(buf, fp); + fputs(buf, chessfp); return 0; } void chc_log_close(void) { - if (fp) - fclose(fp); + if (chessfp) + fclose(chessfp); } int chc_log(char *desc) { - if (fp) - return fputs(desc, fp); + if (chessfp) + return fputs(desc, chessfp); return -1; } @@ -340,7 +340,7 @@ chc_log_poem(void) perror("scandir"); else { char buf[80]; - FILE *fp; // XXX shadow global fp + FILE *fp; sprintf(buf, BBSHOME"/etc/chess/%s", namelist[rand() % n]->d_name); if ((fp = fopen(buf, "r")) == NULL) return -1; -- cgit v1.2.3