Fix a segfault when selecting a non-existent game entry to watch. Found by blackpenguin.

git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@521 db0b04b0-f4d1-0310-9a6d-de3e77497b0e
This commit is contained in:
Pasi Kallinen 2009-12-23 18:04:26 +00:00
parent 4b8e110006
commit 64c9bf043f
2 changed files with 8 additions and 1 deletions

7
TODO
View File

@ -1,3 +1,10 @@
-when exiting from watching a player, move the cursor to the last line
of the screen before enabling the ncurses mode; so when we exit dgl,
the watched player's game is all visible and the menu prompt doesn't
mess it up.
-watching menu will hilight the first matching username... what if we have
more than one game installed, and someone's playing more than one at the
same time? Should also save game#, not just the username.
-allow admin to disabling the 'm' mail key in ttyplay. -allow admin to disabling the 'm' mail key in ttyplay.
-update README -update README
-maybe allow something like changed_menu="[Updated %d]" config option and -maybe allow something like changed_menu="[Updated %d]" config option and

View File

@ -583,7 +583,7 @@ inprogressmenu (int gameid)
if (strchr(selectorchars, menuchoice) && (len > 0)) { if (strchr(selectorchars, menuchoice) && (len > 0)) {
int sidx = strchr(selectorchars, menuchoice) - selectorchars; int sidx = strchr(selectorchars, menuchoice) - selectorchars;
if (sidx > max_height) { if ((sidx > max_height) || (sidx >= len)) {
selected = -1; selected = -1;
break; break;
} }