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

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40714
This commit is contained in:
Sam Lantinga 2003-09-05 15:18:46 +00:00
parent 238f53877d
commit cbe781b5ab

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) ) {