allow "0" in full-screen config menus and plug a few potential related

overflows.


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@765 6ac86273-5f31-0410-b378-82cca8765d1b
This commit is contained in:
Bart Oldeman 2004-01-31 15:06:36 +00:00
parent 272f86af3d
commit 42b55cd1ac
1 changed files with 3 additions and 3 deletions

View File

@ -1882,7 +1882,7 @@ STATIC VOID CfgMenu(BYTE * pLine)
pLine = skipwh(pLine); /* skip more whitespaces... */ pLine = skipwh(pLine); /* skip more whitespaces... */
/* now I'm expecting a number here if this is a menu-choice line. */ /* now I'm expecting a number here if this is a menu-choice line. */
if (pLine[0]>='1' && pLine[0]<='9') if (pLine[0]>='0' && pLine[0]<='9')
{ {
int nIndex = pLine[0]-'0'; int nIndex = pLine[0]-'0';
@ -1989,14 +1989,14 @@ RestartInput:
} }
else if(key == 0x4800 && MenuColor != -1) /* arrow up */ else if(key == 0x4800 && MenuColor != -1) /* arrow up */
{ {
if(MenuSelected>=0 && (Menus & (1 << (MenuSelected-1))) ) if(MenuSelected>=1 && (Menus & (1 << (MenuSelected-1))) )
{ {
MenuSelected--; MenuSelected--;
} }
} }
else if(key == 0x5000 && MenuColor != -1) /* arrow down */ else if(key == 0x5000 && MenuColor != -1) /* arrow down */
{ {
if(MenuSelected<MENULINESMAX && (Menus & (1 << (MenuSelected+1))) ) if(MenuSelected<MENULINESMAX-1 && (Menus & (1 << (MenuSelected+1))) )
{ {
MenuSelected++; MenuSelected++;
} }