[Commits] [SCM] claws branch, master, updated. 3.18.0-269-g34f669fb3

wwp at claws-mail.org wwp at claws-mail.org
Fri Oct 8 13:51:25 CET 2021


The branch, master has been updated
       via  34f669fb3de1fa25e49fc0bcc1f55bd8c4c6d041 (commit)
      from  620c9533038971903ad1965ecb63ab14ac5cbb8e (commit)

Summary of changes:
 src/gtk/gtkutils.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)


- Log -----------------------------------------------------------------
commit 34f669fb3de1fa25e49fc0bcc1f55bd8c4c6d041
Author: wwp <subscript at free.fr>
Date:   Fri Oct 8 15:51:15 2021 +0200

    Fix CID 1491401 and 1491402: (possible) modulo by zero.

diff --git a/src/gtk/gtkutils.c b/src/gtk/gtkutils.c
index 4b5a87e79..e77450f79 100644
--- a/src/gtk/gtkutils.c
+++ b/src/gtk/gtkutils.c
@@ -624,8 +624,8 @@ void gtkut_window_popup(GtkWidget *window)
 	cm_return_if_fail(window != NULL);
 	cm_return_if_fail(gdkwin != NULL);
 
-	sx = gdk_screen_width();
-	sy = gdk_screen_height();
+	sx = MAX(1, gdk_screen_width());
+	sy = MAX(1, gdk_screen_height());
 
 	gdk_window_get_origin(gdkwin, &x, &y);
 	new_x = x % sx; if (new_x < 0) new_x = 0;
@@ -648,8 +648,8 @@ void gtkut_widget_get_uposition(GtkWidget *widget, gint *px, gint *py)
 	cm_return_if_fail(widget != NULL);
 	cm_return_if_fail(gdkwin != NULL);
 
-	sx = gdk_screen_width();
-	sy = gdk_screen_height();
+	sx = MAX(1, gdk_screen_width());
+	sy = MAX(1, gdk_screen_height());
 
 	/* gdk_window_get_root_origin ever return *rootwindow*'s position */
 	gdk_window_get_root_origin(gdkwin, &x, &y);

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list