Fix warning about exceeding bounds of array
Jeffrey Pfau jeffrey@endrift.com
Sat, 11 Oct 2014 15:49:45 -0700
1 files changed,
1 insertions(+),
1 deletions(-)
M
src/gba/renderers/video-software.c
→
src/gba/renderers/video-software.c
@@ -365,7 +365,7 @@ softwareRenderer->windows[activeWindow].control = win->control;
softwareRenderer->windows[activeWindow].endX = win->h.end; if (win->h.end >= oldWindow.endX) { // Trim off extra windows we've overwritten - for (++activeWindow; win->h.end >= softwareRenderer->windows[activeWindow].endX && softwareRenderer->nWindows > activeWindow; ++activeWindow) { + for (++activeWindow; softwareRenderer->nWindows > activeWindow + 1 && win->h.end >= softwareRenderer->windows[activeWindow].endX; ++activeWindow) { softwareRenderer->windows[activeWindow] = softwareRenderer->windows[activeWindow + 1]; --softwareRenderer->nWindows; }