Fixed X11 mode line crash with only one video mode (thanks Alan!)
authorSam Lantinga <slouken@libsdl.org>
Fri, 05 Sep 2003 15:18:46 +0000
changeset 713 7c8deec1659c
parent 712 8be92df64b22
child 714 dfc1c102e825
Fixed X11 mode line crash with only one video mode (thanks Alan!)
src/video/x11/SDL_x11modes.c
--- a/src/video/x11/SDL_x11modes.c	Wed Sep 03 20:07:16 2003 +0000
+++ b/src/video/x11/SDL_x11modes.c	Fri Sep 05 15:18:46 2003 +0000
@@ -120,7 +120,7 @@
                     goto match;
             }
             qsort(modes, nmodes, sizeof *modes, cmpmodes);
-            for ( i = nmodes-1; i >= 0 ; i-- ) {
+            for ( i = nmodes-1; i > 0 ; i-- ) {
 		if ( ! best_width ) {
                     if ( (modes[i]->hdisplay >= width) &&
                          (modes[i]->vdisplay >= height) ) {