diff options
author | ptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-04-30 02:17:49 +0800 |
---|---|---|
committer | ptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-04-30 02:17:49 +0800 |
commit | b46eb1e0f400514ca8fa7a761711040fdbd7dc6a (patch) | |
tree | 97bd16b455489de22e18169d002afad9a1b2b853 /mbbsd | |
parent | 91cb487cf2a689ae2d970dd34213f8a8cdd03988 (diff) | |
download | pttbbs-b46eb1e0f400514ca8fa7a761711040fdbd7dc6a.tar pttbbs-b46eb1e0f400514ca8fa7a761711040fdbd7dc6a.tar.gz pttbbs-b46eb1e0f400514ca8fa7a761711040fdbd7dc6a.tar.bz2 pttbbs-b46eb1e0f400514ca8fa7a761711040fdbd7dc6a.tar.lz pttbbs-b46eb1e0f400514ca8fa7a761711040fdbd7dc6a.tar.xz pttbbs-b46eb1e0f400514ca8fa7a761711040fdbd7dc6a.tar.zst pttbbs-b46eb1e0f400514ca8fa7a761711040fdbd7dc6a.zip |
change a little in chicken log_file
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1891 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r-- | mbbsd/chicken.c | 26 |
1 files 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)); } } |