diff options
author | ptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-04-24 04:49:16 +0800 |
---|---|---|
committer | ptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-04-24 04:49:16 +0800 |
commit | 77977eec595648e9143769c7993c65490b753b99 (patch) | |
tree | e3fa49665ab69c7ac59c11323044dd6d545b8f26 | |
parent | da56c5ed1f424f78040d2bd7f11833978eeb46b8 (diff) | |
download | pttbbs-77977eec595648e9143769c7993c65490b753b99.tar pttbbs-77977eec595648e9143769c7993c65490b753b99.tar.gz pttbbs-77977eec595648e9143769c7993c65490b753b99.tar.bz2 pttbbs-77977eec595648e9143769c7993c65490b753b99.tar.lz pttbbs-77977eec595648e9143769c7993c65490b753b99.tar.xz pttbbs-77977eec595648e9143769c7993c65490b753b99.tar.zst pttbbs-77977eec595648e9143769c7993c65490b753b99.zip |
modify a little for vmsg
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1837 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | include/proto.h | 2 | ||||
-rw-r--r-- | mbbsd/bbs.c | 2 | ||||
-rw-r--r-- | mbbsd/edit.c | 4 | ||||
-rw-r--r-- | mbbsd/stuff.c | 9 |
4 files changed, 9 insertions, 8 deletions
diff --git a/include/proto.h b/include/proto.h index 773a5a0c..01593227 100644 --- a/include/proto.h +++ b/include/proto.h @@ -479,7 +479,7 @@ void out_lines(char *str, int line); #define isprint2(ch) ((ch & 0x80) || isprint(ch)) #define not_alpha(ch) (ch < 'A' || (ch > 'Z' && ch < 'a') || ch > 'z') #define not_alnum(ch) (ch < '0' || (ch > '9' && ch < 'A') || (ch > 'Z' && ch < 'a') || ch > 'z') -#define pressanykey() vmsg_lines(b_lines, "") +#define pressanykey() vmsg_lines(b_lines, NULL) int vmsg_lines(int lines, const char *msg); time_t gettime(int line, time_t dt, char* head); void setcalfile(char *buf, char *userid); 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); } |