diff options
author | Maya Rashish <maya@NetBSD.org> | 2019-01-10 20:49:28 +0200 |
---|---|---|
committer | Maya Rashish <maya@NetBSD.org> | 2019-01-10 20:49:28 +0200 |
commit | c214ab0d7deae30acdf90933ed14b223118dcf67 (patch) | |
tree | 01dc334330dffe1c2ac9ceb0a3e32f6c6d4cd02f | |
parent | 8e34a2aa7c4dea5aa07dc08a40dacd90e2148a89 (diff) |
Avoid undefined behaviour
Left shifting a negative is undefined.
For consistency, use the equivalent form of multiplication for the
positive numbers as well.
-rw-r--r-- | struct.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -491,8 +491,8 @@ fontMetrics(FontPtr font, { int i, rc; int max_awidth = 0; - int min_x = 10000 << 16, min_y = 10000 << 16; - int max_x = -10000 << 16, max_y = -10000 << 16; + int min_x = 10000 * 65536, min_y = 10000 * 65536; + int max_x = -10000 * 65536, max_y = -10000 * 65536; for(i = 0; i < FONT_CODES; i++) { int awidth, x0, y0, x1, y1; rc = glyphMetrics(font, i, &awidth, &x0, &y0, &x1, &y1); |