]> skyeroc.xyz Git - dgamelaunch/commitdiff
Prevent a segfault when trying to watch a game when none is available.
authorPasi Kallinen <paxed@alt.org>
Sun, 18 Oct 2009 17:25:18 +0000 (17:25 +0000)
committerPasi Kallinen <paxed@alt.org>
Sun, 18 Oct 2009 17:25:18 +0000 (17:25 +0000)
Also disable '/' when no games available.

git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@498 db0b04b0-f4d1-0310-9a6d-de3e77497b0e

dgamelaunch.c

index 0f97f85ca00839eebe50a0173358cd0564b7ebda..95962e9de29c229c3a317ed949e1684113244e34 100644 (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) {