From: Mikael Magnusson Date: Fri, 5 May 2017 17:57:15 +0000 (+0200) Subject: Don't clobber loop variable with return value X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=49fb7f52e5488f7b13702d40e94b1b05c6cb2fb5;p=mikachu%2Fopenbox.git Don't clobber loop variable with return value Fixes bug 6383. --- diff --git a/openbox/screen.c b/openbox/screen.c index e758ada1..31cb8ded 100644 --- a/openbox/screen.c +++ b/openbox/screen.c @@ -1903,18 +1903,21 @@ guint screen_monitor_pointer() gboolean screen_pointer_pos(gint *x, gint *y) { - Window w; gint i; - guint u; gboolean ret; + /* we don't care about any of these return values, but we can't pass NULL */ + Window w; + guint u; + gint j; + ret = !!XQueryPointer(obt_display, obt_root(ob_screen), - &w, &w, x, y, &i, &i, &u); + &w, &w, x, y, &j, &j, &u); if (!ret) { for (i = 0; i < ScreenCount(obt_display); ++i) if (i != ob_screen) - if (XQueryPointer(obt_display, obt_root(i), - &w, &w, x, y, &i, &i, &u)) + if ((ret=XQueryPointer(obt_display, obt_root(i), + &w, &w, x, y, &j, &j, &u))) break; } return ret;