summaryrefslogtreecommitdiffstats
path: root/extra/xaw3d/Xaw3d-1.5-box.c.patch
blob: 252238af8fdf00ed644d88928bb008e9fd79deb6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#! /bin/sh /usr/share/dpatch/dpatch-run
## box.c.dpatch by Francesco Paolo Lovergine <frankie@debian.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: No description.

@DPATCH@
diff -urNad xaw3d-1.5+E~/lib/Xaw3d/Box.c xaw3d-1.5+E/lib/Xaw3d/Box.c
--- Xaw3d-1.5E/xc/lib/Xaw3d/Box.c	1996-10-15 16:41:18.000000000 +0200
+++ Xaw3d-1.5E/xc/lib/Xaw3d/Box.c	2007-04-24 15:28:39.000000000 +0200
@@ -353,8 +353,16 @@
 	else {
 	    width = preferred_width;
 	    do { /* find some width big enough to stay within this height */
+#if 0 
 		width *= 2;
 		if (width > constraint->width) width = constraint->width;
+#endif
+                if (width > constraint->width/2) {  /* avoid short int overflow */
+ 		    width = constraint->width;
+		}
+                else { 
+		    width *= 2; 
+		}
 		DoLayout(w, width, 0, &preferred_width, &preferred_height, FALSE);
 	    } while (preferred_height > constraint->height &&
 		     width < constraint->width);