From 77977eec595648e9143769c7993c65490b753b99 Mon Sep 17 00:00:00 2001 From: ptt Date: Fri, 23 Apr 2004 20:49:16 +0000 Subject: modify a little for vmsg git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1837 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/bbs.c | 2 +- mbbsd/edit.c | 4 ++-- mbbsd/stuff.c | 9 +++++---- 3 files changed, 8 insertions(+), 7 deletions(-) (limited to 'mbbsd') diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c index 4bf0fab4..7719f140 100644 --- a/mbbsd/bbs.c +++ b/mbbsd/bbs.c @@ -1930,7 +1930,7 @@ del_post(int ent, fileheader_t * fhdr, char *direct) cuser.numposts--; if (!(currmode & MODE_DIGEST && currmode & MODE_BOARD)){ demoney(-fhdr->money); - vmsg("%s,您的文章減為 %d 篇,支付清潔費 %d 銀", msg_del_ok, + vmsg("您的文章減為 %d 篇,支付清潔費 %d 銀", cuser.numposts, fhdr->money); } } diff --git a/mbbsd/edit.c b/mbbsd/edit.c index f9cb439a..02eca6b2 100644 --- a/mbbsd/edit.c +++ b/mbbsd/edit.c @@ -965,7 +965,7 @@ write_file(char *fpath, int saveheader, int *islocal) switch (ans[0]) { case 'a': - vmsg("文章\033[1m 沒有 \033[m存入"); + outs("文章\033[1m 沒有 \033[m存入"); aborted = -1; break; case 'r': @@ -2022,7 +2022,7 @@ vedit(char *fpath, int saveheader, int *islocal) case '\n': #ifdef MAX_EDIT_LINE if( totaln == MAX_EDIT_LINE ){ - vmsg("MAX_EDIT_LINE exceed"); + outs("MAX_EDIT_LINE exceed"); break; } #endif diff --git a/mbbsd/stuff.c b/mbbsd/stuff.c index 605e8cd3..fc2ce69d 100644 --- a/mbbsd/stuff.c +++ b/mbbsd/stuff.c @@ -439,14 +439,15 @@ getans(const char *fmt,...) int vmsg(const char *fmt,...) { - char msg[80] = "\033[1;36;44m ◆ ", i; + char msg[128] = "\033[1;36;44m ◆ ", i; va_list ap; va_start(ap, fmt); - vsnprintf(msg+14, 55, fmt, ap); + i = vsnprintf(msg+14, 100, fmt, ap); va_end(ap); - for(i=69; i>0 && *(msg+i+1); i--) + for(; i<69; i++) *(msg+i) = ' '; - strcat(msg+69,"\033[33;46m \033[200m\033[1431m\033[506m[請按任意鍵繼續]\033[201m \033[m"); + strcat(msg+69, + "\033[33;46m \033[200m\033[1431m\033[506m[請按任意鍵繼續]\033[201m \033[m"); return vmsg_lines(b_lines, msg); } -- cgit v1.2.3