aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarish Krishnaswamy <kharish@novell.com>2005-11-17 12:41:41 +0800
committerHarish Krishnaswamy <kharish@src.gnome.org>2005-11-17 12:41:41 +0800
commit577b578fd4c13e30ed61b503cb9a9b39da4753b0 (patch)
tree73eee7f9fe2443a7134878d5930eef94aa85c0a1
parentec7081a5db22f7c8766d824e4852910b714d1028 (diff)
downloadgsoc2013-evolution-577b578fd4c13e30ed61b503cb9a9b39da4753b0.tar.gz
gsoc2013-evolution-577b578fd4c13e30ed61b503cb9a9b39da4753b0.tar.zst
gsoc2013-evolution-577b578fd4c13e30ed61b503cb9a9b39da4753b0.zip
Fix a division-by-zero error crasher. (Update: when in doubt, protect with
2005-11-17 Harish Krishnaswamy <kharish@novell.com> * 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
-rw-r--r--widgets/misc/e-attachment-bar.c4
1 files 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);
}