summaryrefslogtreecommitdiff
path: root/x11/Xaw3d/patches/patch-ac
blob: 0525528ea4b37a54d7f268a5a900cf79cf49c96c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
$NetBSD: patch-ac,v 1.1 2006/03/13 00:16:23 markd Exp $

--- Box.c.orig	1996-10-16 03:41:18.000000000 +1300
+++ Box.c
@@ -352,8 +352,12 @@ static XtGeometryResult PreferredSize(wi
 	}
 	else {
 	    width = preferred_width;
+	    if (0==width) width=1;
 	    do { /* find some width big enough to stay within this height */
-		width *= 2;
+		if (width>=32768) /* overflow */
+		    width=constraint->width;
+		else
+		    width *= 2;
 		if (width > constraint->width) width = constraint->width;
 		DoLayout(w, width, 0, &preferred_width, &preferred_height, FALSE);
 	    } while (preferred_height > constraint->height &&