summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2008-09-07 21:46:45 -0700
committerArnaud Fontaine <arnau@debian.org>2010-11-14 19:50:13 +0900
commit8a4dfb917f12b4e3ef36d135081379927c1ca1db (patch)
treec5d43ee2159a185f13c16024966a4064c1653e89
parent07385216de016e272a7d65978e8c2a86782a62e3 (diff)
xcb_mask must not be zero when n == 32.
left shift of a 32-bit value by 32 is undefined, don't try to use it.
-rw-r--r--aux/xcb_bitops.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/aux/xcb_bitops.h b/aux/xcb_bitops.h
index 48c3401..a6872a1 100644
--- a/aux/xcb_bitops.h
+++ b/aux/xcb_bitops.h
@@ -51,7 +51,7 @@
_X_INLINE static uint32_t
xcb_mask(uint32_t n)
{
- return (1 << n) - 1;
+ return n == 32 ? ~0 : (1 << n) - 1;
}