Prevent a segfault when trying to watch a game when none is available.

Also disable '/' when no games available. 


git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@498 db0b04b0-f4d1-0310-9a6d-de3e77497b0e
This commit is contained in:
Pasi Kallinen 2009-10-18 17:25:18 +00:00
parent 6a703c4bf7
commit 857105e8b2
1 changed files with 2 additions and 1 deletions

View File

@ -505,6 +505,7 @@ inprogressmenu (int gameid)
{
int match = -1;
char findname[21];
if (len <= 0) break;
findname[0] = '\0';
mvprintw ((btm+2+top_banner_hei), 1, "Watch which player? => "); /* stupid... */
mvaddstr ((btm+2+top_banner_hei), 1, "Watch which player? => ");
@ -566,7 +567,7 @@ inprogressmenu (int gameid)
break;
default:
if (strchr(selectorchars, menuchoice)) {
if (strchr(selectorchars, menuchoice) && (len > 0)) {
int sidx = strchr(selectorchars, menuchoice) - selectorchars;
if (sidx > max_height) {