summaryrefslogtreecommitdiff
path: root/gtk/gtkrange.c
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2002-05-16 16:57:18 +0000
committerOwen Taylor <otaylor@src.gnome.org>2002-05-16 16:57:18 +0000
commitce5029dfa9019fb408de180d446e1ffb8cbdc7e7 (patch)
tree639626b0efe198a2685ff91319a185ba557e3d3c /gtk/gtkrange.c
parentbcce8104efa60499f1a5f88bbcf018f00d117605 (diff)
downloadgtk+-ce5029dfa9019fb408de180d446e1ffb8cbdc7e7.tar.gz
Fix a missed check for division by zero. (#77820, Gareth Pearce)
Thu May 16 12:56:38 2002 Owen Taylor <otaylor@redhat.com> * gtk/gtkrange.c (gtk_range_calc_layout): Fix a missed check for division by zero. (#77820, Gareth Pearce)
Diffstat (limited to 'gtk/gtkrange.c')
-rw-r--r--gtk/gtkrange.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gtk/gtkrange.c b/gtk/gtkrange.c
index 6ce27d35a8..d815343de2 100644
--- a/gtk/gtkrange.c
+++ b/gtk/gtkrange.c
@@ -2181,8 +2181,12 @@ gtk_range_calc_layout (GtkRange *range,
/* slider width is the fraction (page_size /
* total_adjustment_range) times the trough width in pixels
*/
- width = ((right - left) * (range->adjustment->page_size /
+
+ if (range->adjustment->upper - range->adjustment->lower != 0)
+ width = ((right - left) * (range->adjustment->page_size /
(range->adjustment->upper - range->adjustment->lower)));
+ else
+ width = range->min_slider_size;
if (width < range->min_slider_size ||
range->slider_size_fixed)