forked from AuroraMiddleware/gtk
gdk_x11_display_get_monitor: fix monitor number test logic
When asked for a nonexistent (positive) monitor number, gdk_x11_display_get_monitor would (at best) return an uninitialized pointer, instead of returning NULL.
This commit is contained in:
parent
bb8f6f87ae
commit
bb8debe925
@ -2951,7 +2951,7 @@ gdk_x11_display_get_monitor (GdkDisplay *display,
|
||||
{
|
||||
GdkX11Display *x11_display = GDK_X11_DISPLAY (display);
|
||||
|
||||
if (0 <= monitor_num || monitor_num < x11_display->monitors->len)
|
||||
if (0 <= monitor_num && monitor_num < x11_display->monitors->len)
|
||||
return (GdkMonitor *)x11_display->monitors->pdata[monitor_num];
|
||||
|
||||
return NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user