summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-01-23 18:57:01 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-01-23 18:57:01 +0800
commitfd18635c94ab081a973fc9193b562626fd7827f2 (patch)
tree398bbd37b46223951f8486be6d29b0ea1ea24ae1
parent500d42a24d1c0436a4a1af60bc195ad01027d072 (diff)
downloadpttbbs-fd18635c94ab081a973fc9193b562626fd7827f2.tar
pttbbs-fd18635c94ab081a973fc9193b562626fd7827f2.tar.gz
pttbbs-fd18635c94ab081a973fc9193b562626fd7827f2.tar.bz2
pttbbs-fd18635c94ab081a973fc9193b562626fd7827f2.tar.lz
pttbbs-fd18635c94ab081a973fc9193b562626fd7827f2.tar.xz
pttbbs-fd18635c94ab081a973fc9193b562626fd7827f2.tar.zst
pttbbs-fd18635c94ab081a973fc9193b562626fd7827f2.zip
- menu: cursor_position is not really useful. and it will cause SEGV for
large cmdmode (why not crashed before?). Let's remove it. git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3855 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--mbbsd/menu.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/mbbsd/menu.c b/mbbsd/menu.c
index a28047b2..31d0798f 100644
--- a/mbbsd/menu.c
+++ b/mbbsd/menu.c
@@ -221,7 +221,7 @@ show_menu(int moviemode, const commands_t * p)
enum {
M_ADMIN = 0, M_AMUSE, M_CHC, M_JCEE, M_MAIL, M_MMENU, M_NMENU,
- M_PMENU, M_PSALE, M_SREG, M_TMENU, M_UMENU, M_XMENU,
+ M_PMENU, M_PSALE, M_SREG, M_TMENU, M_UMENU, M_XMENU, M_XMAX
};
static const int mode_map[] = {
@@ -236,14 +236,10 @@ domenu(int cmdmode, const char *cmdtitle, int cmd, const commands_t cmdtable[])
int n, pos, total, i;
int err;
- static char cursor_position[sizeof(mode_map) / sizeof(mode_map[0])] = { 0 };
-
moviemode = cmdmode;
+ assert(cmdmode < M_XMAX);
cmdmode = mode_map[cmdmode];
- if (cursor_position[cmdmode])
- cmd = cursor_position[cmdmode];
-
setutmpmode(cmdmode);
showtitle(cmdtitle, BBSName);
@@ -331,7 +327,6 @@ domenu(int cmdmode, const char *cmdtitle, int cmd, const commands_t cmdtable[])
cmd = cmdtable[lastcmdptr].desc[0];
else
cmd = cmdtable[lastcmdptr].desc[1];
- cursor_position[cmdmode] = cmdtable[lastcmdptr].desc[0];
}
if (cmd >= 'a' && cmd <= 'z')
cmd &= ~0x20;