From fa903461ecadaa38eaf36a9ef7550fc76d9f3666 Mon Sep 17 00:00:00 2001 From: Jaimos Skriletz Date: Thu, 17 Oct 2024 11:44:45 -0600 Subject: [PATCH] Fix error in FindScreenOfXY In the previous commit, I defined the m_min variable both inside and outside of an if block (forgot to delete the inside one). So delete the extra definition. Also set m_min to the old return of RB_MIN just in case (this also suppresses warnings from my complier). --- libs/FScreen.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libs/FScreen.c b/libs/FScreen.c index 6cc1693d6..d65931770 100644 --- a/libs/FScreen.c +++ b/libs/FScreen.c @@ -824,13 +824,12 @@ FindScreenOfXY(int x, int y) return (m); } - struct monitor *m_min; + struct monitor *m_min = NULL; if (m == NULL) { /* No monitor found, point is in a dead area. * Find closest monitor using the taxi cab metric. */ int dmin = INT_MAX; - struct monitor *m_min; RB_FOREACH(m, monitors, &monitor_q) { int d = 0;