Commit 59136773 authored by Sébastien Villemot's avatar Sébastien Villemot Committed by Daniel Boles

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.

parent 7a75b89e
Pipeline #8460 passed with stage
in 29 minutes and 41 seconds
......@@ -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;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment