From 577b578fd4c13e30ed61b503cb9a9b39da4753b0 Mon Sep 17 00:00:00 2001 From: Harish Krishnaswamy Date: Thu, 17 Nov 2005 04:41:41 +0000 Subject: Fix a division-by-zero error crasher. (Update: when in doubt, protect with 2005-11-17 Harish Krishnaswamy * e-attachment-bar.c: (update), (e_attachment_bar_set_width): Fix a division-by-zero error crasher. (Update: when in doubt, protect with parenthesis :-)) svn path=/trunk/; revision=30631 --- widgets/misc/e-attachment-bar.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/widgets/misc/e-attachment-bar.c b/widgets/misc/e-attachment-bar.c index 15d8331e5b..3c39b665ab 100644 --- a/widgets/misc/e-attachment-bar.c +++ b/widgets/misc/e-attachment-bar.c @@ -415,7 +415,7 @@ update (EAttachmentBar *bar) calculate_height_width(bar, &width, &height); per_col = bar_width / width; - per_col = per_col ? per_col : 1; + per_col = (per_col ? per_col : 1); rows = (bar->priv->num_attachments + per_col -1 )/ per_col; gtk_widget_set_size_request ((GtkWidget *)bar, bar_width, rows * height); } @@ -506,7 +506,7 @@ e_attachment_bar_set_width(EAttachmentBar *bar, int bar_width) calculate_height_width(bar, &width, &height); per_col = bar_width / width; - per_col = per_col ? per_col : 1; + per_col = (per_col ? per_col : 1); rows = (bar->priv->num_attachments + per_col - 1) / per_col; gtk_widget_set_size_request ((GtkWidget *)bar, bar_width, rows * height); } -- cgit v1.2.3