Fixed X11 mode line crash with only one video mode (thanks Alan!)

This commit is contained in:
Sam Lantinga 2003-09-05 15:18:46 +00:00
parent 974d05bb9a
commit 76102d9c11

View File

@ -120,7 +120,7 @@ static void set_best_resolution(_THIS, int width, int height)
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) ) {