diff options
Diffstat (limited to 'mbbsd')
-rw-r--r-- | mbbsd/admin.c | 6 | ||||
-rw-r--r-- | mbbsd/stuff.c | 23 |
2 files changed, 13 insertions, 16 deletions
diff --git a/mbbsd/admin.c b/mbbsd/admin.c index aa370b1e..aa498b93 100644 --- a/mbbsd/admin.c +++ b/mbbsd/admin.c @@ -955,13 +955,13 @@ scan_register_form(char *regfile, int automode, int neednum) prints("%d.%-12s:%s\n", n - 2, finfo[n], fdata[n]); } if (muser.userlevel & PERM_LOGINOK) { - ans[0]=getans("此帳號已經完成註冊, " - "更新(Y/N/Skip)?[N] "); + ans[0] = getans("此帳號已經完成註冊, " + "更新(Y/N/Skip)?[N] "); if (ans[0] != 'y' && ans[0] != 's') ans[0] = 'd'; } else { if (search_ulist(unum) == NULL) - ans[0] = getans("是否接受此資料(Y/N/Q/Del/Skip)?[S] "); + ans[0] = vmsg_lines(22, "是否接受此資料(Y/N/Q/Del/Skip)?[S])"); else ans[0] = 's'; if ('A' <= ans[0] && ans[0] <= 'Z') diff --git a/mbbsd/stuff.c b/mbbsd/stuff.c index dd8bb969..00c307fb 100644 --- a/mbbsd/stuff.c +++ b/mbbsd/stuff.c @@ -425,15 +425,12 @@ vmsg_lines(const int lines, const char msg[]) return ch; } -int -getans(const char *fmt,...) +char getans(char *prompt) { - char msg[256] = {0}; - va_list ap; - va_start(ap, fmt); - vsnprintf(msg, sizeof(msg), fmt, ap); - va_end(ap); - return vmsg_lines(b_lines, msg); + char ans[5]; + + getdata(b_lines, 0, prompt, ans, sizeof(ans), LCECHO); + return ans[0]; } int @@ -442,12 +439,12 @@ vmsg(const char *fmt,...) char msg[256] = "\033[1;36;44m ◆ ", i; va_list ap; va_start(ap, fmt); - i = vsnprintf(msg+14, 100, fmt, ap); + i = vsnprintf(msg + 14, 100, fmt, ap); va_end(ap); - for(i=i+14; i<71; i++) - *(msg+i) = ' '; - strcat(msg+71, - "\033[33;46m \033[200m\033[1431m\033[506m[按任意鍵繼續]\033[201m \033[m"); + for(i = i + 14; i < 71; i++) + msg[(int)i] = ' '; + strcat(msg + 71, + "\033[33;46m \033[200m\033[1431m\033[506m[按任意鍵繼續]\033[201m \033[m"); return vmsg_lines(b_lines, msg); } |