diff options
author | ptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-04-29 01:32:44 +0800 |
---|---|---|
committer | ptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-04-29 01:32:44 +0800 |
commit | a314010f2ad139a872ff1a3960a9a5dec91e913e (patch) | |
tree | 66dfe08de6ae89f4d72daef6c6971171f5dd101e | |
parent | 7f83ab24bc6209de9db34b8b7894698eb65b1f17 (diff) | |
download | pttbbs-a314010f2ad139a872ff1a3960a9a5dec91e913e.tar pttbbs-a314010f2ad139a872ff1a3960a9a5dec91e913e.tar.gz pttbbs-a314010f2ad139a872ff1a3960a9a5dec91e913e.tar.bz2 pttbbs-a314010f2ad139a872ff1a3960a9a5dec91e913e.tar.lz pttbbs-a314010f2ad139a872ff1a3960a9a5dec91e913e.tar.xz pttbbs-a314010f2ad139a872ff1a3960a9a5dec91e913e.tar.zst pttbbs-a314010f2ad139a872ff1a3960a9a5dec91e913e.zip |
fix some stuff for getkey
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1885 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | mbbsd/stuff.c | 4 | ||||
-rw-r--r-- | mbbsd/user.c | 7 |
2 files changed, 5 insertions, 6 deletions
diff --git a/mbbsd/stuff.c b/mbbsd/stuff.c index 28388960..7ffc4f92 100644 --- a/mbbsd/stuff.c +++ b/mbbsd/stuff.c @@ -436,10 +436,10 @@ char getans(char *prompt) int getkey(const char *fmt,...) { - char msg[256] = "\033[1;36;44m ◆ ", i; + char msg[256], i; va_list ap; va_start(ap, fmt); - i = vsnprintf(msg + 14, 100, fmt, ap); + i = vsnprintf(msg , 100, fmt, ap); va_end(ap); return vmsg_lines(b_lines, msg); } diff --git a/mbbsd/user.c b/mbbsd/user.c index 127de100..bd4ed6b8 100644 --- a/mbbsd/user.c +++ b/mbbsd/user.c @@ -23,7 +23,6 @@ u_loginview() { int i; unsigned int pbits = cuser.loginview; - char choice[5]; clear(); move(4, 0); @@ -32,9 +31,9 @@ u_loginview() loginview_file[i][1], ((pbits >> i) & 1 ? "ˇ" : "X")); clrtobot(); - while (getdata(b_lines - 1, 0, "請按 [A-N] 切換設定,按 [Return] 結束:", - choice, 3, LCECHO)) { - i = choice[0] - 'a'; + while ((i = getkey("請按 [A-N] 切換設定,按 [Return] 結束:"))!='\r') + { + i = i - 'a'; if (i >= NUMVIEWFILE || i < 0) bell(); else { |