diff --git a/objects/screen.c b/objects/screen.c index c4a0ee586..a41fb1524 100644 --- a/objects/screen.c +++ b/objects/screen.c @@ -364,7 +364,7 @@ screen_getbycoord(int x, int y) return *s; /* No screen found, find nearest screen. */ - screen_t *nearest_screen = globalconf.screens.tab[0]; + screen_t *nearest_screen = NULL; unsigned int nearest_dist = UINT_MAX; foreach(s, globalconf.screens) {