From 89a5a6429eee8f29b003c6be1ac97ba106dc2b88 Mon Sep 17 00:00:00 2001 From: Ludwig Nussel Date: Sun, 13 Apr 2008 08:30:48 +0000 Subject: [PATCH] sort video modes only if there are modes to sort --- code/sdl/sdl_glimp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/sdl/sdl_glimp.c b/code/sdl/sdl_glimp.c index a6c0a302..b933a865 100644 --- a/code/sdl/sdl_glimp.c +++ b/code/sdl/sdl_glimp.c @@ -166,7 +166,8 @@ static void GLimp_DetectAvailableModes(void) for( numModes = 0; modes[ numModes ]; numModes++ ); - qsort( modes, numModes, sizeof( SDL_Rect* ), GLimp_CompareModes ); + if(numModes > 1) + qsort( modes+1, numModes-1, sizeof( SDL_Rect* ), GLimp_CompareModes ); for( i = 0; i < numModes; i++ ) {