summaryrefslogtreecommitdiffstats
path: root/mbbsd/stuff.c
diff options
context:
space:
mode:
Diffstat (limited to 'mbbsd/stuff.c')
-rw-r--r--mbbsd/stuff.c23
1 files changed, 10 insertions, 13 deletions
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);
}