qrun: fix a nasty memory scribble
authorAlan Cox <alan@linux.intel.com>
Sat, 20 May 2017 15:49:22 +0000 (16:49 +0100)
committerAlan Cox <alan@linux.intel.com>
Sat, 20 May 2017 15:49:22 +0000 (16:49 +0100)
Also clean up the graphics check

Applications/games/qrun.c

index 4f01102..14dbb1c 100644 (file)
@@ -1130,7 +1130,7 @@ static void initgame(void)
                state.flags[n] = 0;
 
        NUMCAR = 0;
-       for (n = 0; n < 255; n++) {
+       for (n = 0; n < nobj; n++) {
                state.objpos[n] = zmem(obase + n);
                if (state.objpos[n] == 254)
                        NUMCAR++;
@@ -1736,7 +1736,7 @@ static void initdisplay(void)
                has_gfx = 0;
                return;
        }
-       if (m.commands & (GFX_WRITE | GFX_DRAW) == (GFX_WRITE | GFX_DRAW))
+       if ((m.commands & (GFX_WRITE | GFX_DRAW)) == (GFX_WRITE | GFX_DRAW))
                has_gfx = 1;
        pixw = m.width;
        pixh = m.height;