[PATCH 3/5] Missing parens in REQUEST_FIXED_SIZE macro

Keith Packard keithp at keithp.com
Tue Dec 9 09:30:59 PST 2014


The 'n' parameter must be surrounded by parens in both places to
prevent precedence from mis-computing things.

Signed-off-by: Keith Packard <keithp at keithp.com>
---
 include/dix.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/dix.h b/include/dix.h
index 21176a8..921156b 100644
--- a/include/dix.h
+++ b/include/dix.h
@@ -80,7 +80,7 @@ SOFTWARE.
 
 #define REQUEST_FIXED_SIZE(req, n)\
     if (((sizeof(req) >> 2) > client->req_len) || \
-        ((n >> 2) >= client->req_len) || \
+        (((n) >> 2) >= client->req_len) ||                              \
         ((((uint64_t) sizeof(req) + (n) + 3) >> 2) != (uint64_t) client->req_len))  \
          return(BadLength)
 
-- 
2.1.3



More information about the xorg-devel mailing list