summaryrefslogtreecommitdiffstats
path: root/mbbsd
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-04-28 21:11:28 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-04-28 21:11:28 +0800
commit6aa3fa39ec6f366c494713f9ecf0dee5056a4866 (patch)
tree7f83e048da0e2861feefbcacdea4882f5845cbda /mbbsd
parent44b5791441596b3b6108c7f2771a9ae1ebfb985b (diff)
downloadpttbbs-6aa3fa39ec6f366c494713f9ecf0dee5056a4866.tar
pttbbs-6aa3fa39ec6f366c494713f9ecf0dee5056a4866.tar.gz
pttbbs-6aa3fa39ec6f366c494713f9ecf0dee5056a4866.tar.bz2
pttbbs-6aa3fa39ec6f366c494713f9ecf0dee5056a4866.tar.lz
pttbbs-6aa3fa39ec6f366c494713f9ecf0dee5056a4866.tar.xz
pttbbs-6aa3fa39ec6f366c494713f9ecf0dee5056a4866.tar.zst
pttbbs-6aa3fa39ec6f366c494713f9ecf0dee5056a4866.zip
use old getans()
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1882 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r--mbbsd/admin.c6
-rw-r--r--mbbsd/stuff.c23
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);
}