diff options
author | Stuart Kreitman <Stuart.Kreitman@sun.com> | 2008-08-04 17:12:58 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@sun.com> | 2008-08-04 17:12:58 -0700 |
commit | 0de4f54967a7ab923817712eb96b64ca1ebe84a5 (patch) | |
tree | de029864835b0467b7f04fbf912e76cc77a591c6 | |
parent | d8b7fa56de252ba78edab5e504a2c7650e9e9123 (diff) |
Avoid divide by zero crash if DDX mistakenly returns screen size of 0mm.
-rw-r--r-- | xrdb.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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; } |