Fix screen number checks.

screenInfo.numScreens is not a valid screen number, they go from 0 to
numScreens - 1.

Signed-off-by: Cyril Brulebois <kibi@debian.org>
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
Cyril Brulebois
2010-12-01 14:12:55 +01:00
committed by Keith Packard
parent 8684543021
commit 279ef1ffd7
3 changed files with 5 additions and 5 deletions

View File

@@ -398,7 +398,7 @@ EphyrDuplicateVisual (unsigned int a_screen,
int i=0 ;
EPHYR_LOG ("enter\n") ;
if (a_screen > screenInfo.numScreens) {
if (a_screen >= screenInfo.numScreens) {
EPHYR_LOG_ERROR ("bad screen number\n") ;
goto out;
}