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. https://gitlab.gnome.org/GNOME/gtk/merge_requests/107
This commit is contained in:
parent
7a75b89efe
commit
59136773b8
@ -3122,7 +3122,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