From b46eb1e0f400514ca8fa7a761711040fdbd7dc6a Mon Sep 17 00:00:00 2001 From: ptt Date: Thu, 29 Apr 2004 18:17:49 +0000 Subject: change a little in chicken log_file git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1891 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/chicken.c | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/mbbsd/chicken.c b/mbbsd/chicken.c index 78268e49..7af6a7b3 100644 --- a/mbbsd/chicken.c +++ b/mbbsd/chicken.c @@ -642,7 +642,6 @@ deadtype(chicken_t * thechicken) { chicken_t *mychicken = &cuser.mychicken; int i; - char buf[150]; if (thechicken->hp <= 0) /* hp用盡 */ i = 1; @@ -659,13 +658,10 @@ deadtype(chicken_t * thechicken) return 0; if (thechicken == mychicken) { - snprintf(buf, sizeof(buf), - "\033[31m%s\033[m 所疼愛的\033[33m %s\033[32m %s " - "\033[m掛了 於 %s\n", - cuser.userid, thechicken->name, - chicken_type[(int)thechicken->type], - ctime(&now)); - log_file(CHICKENLOG, buf, 1); + log_file(CHICKENLOG, 1, + "\033[31m%s\033[m 所疼愛的\033[33m %s\033[32m %s " + "\033[m掛了 於 %s\n", cuser.userid, thechicken->name, + chicken_type[(int)thechicken->type], ctime(&now)); mychicken->name[0] = 0; passwd_update(usernum, &cuser); } @@ -712,20 +708,18 @@ static void ch_changename() { chicken_t *mychicken = &cuser.mychicken; - char buf[150], newname[20] = ""; + char newname[20] = ""; getdata_str(b_lines - 1, 0, "嗯..改個好名字吧:", newname, 18, DOECHO, mychicken->name); if (strlen(newname) >= 3 && strcmp(newname, mychicken->name)) { - snprintf(buf, sizeof(buf), - "\033[31m%s\033[m 把疼愛的\033[33m %s\033[32m %s " - "\033[m改名為\033[33m %s\033[m 於 %s\n", - cuser.userid, mychicken->name, - chicken_type[(int)mychicken->type], - newname, ctime(&now)); strlcpy(mychicken->name, newname, sizeof(mychicken->name)); - log_file(CHICKENLOG, buf, 1); + log_file(CHICKENLOG, 1, + "\033[31m%s\033[m 把疼愛的\033[33m %s\033[32m %s " + "\033[m改名為\033[33m %s\033[m 於 %s\n", + cuser.userid, mychicken->name, + chicken_type[(int)mychicken->type], newname, ctime(&now)); } } -- cgit v1.2.3