summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStuart Kreitman <Stuart.Kreitman@sun.com>2008-08-04 17:12:58 -0700
committerAlan Coopersmith <alan.coopersmith@sun.com>2008-08-04 17:12:58 -0700
commit0de4f54967a7ab923817712eb96b64ca1ebe84a5 (patch)
treede029864835b0467b7f04fbf912e76cc77a591c6
parentd8b7fa56de252ba78edab5e504a2c7650e9e9123 (diff)
Avoid divide by zero crash if DDX mistakenly returns screen size of 0mm.
-rw-r--r--xrdb.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/xrdb.c b/xrdb.c
index 050b4f8..3e01629 100644
--- a/xrdb.c
+++ b/xrdb.c
@@ -489,7 +489,10 @@ DoCmdDefines(String *buff)
static int
Resolution(int pixels, int mm)
{
- return ((pixels * 100000 / mm) + 50) / 100;
+ if (mm == 0)
+ return 0;
+ else
+ return ((pixels * 100000 / mm) + 50) / 100;
}