Fix bug in flag checking discovered by ratty
authorMichael Poole <mdpoole@troilus.org>
Wed, 25 Aug 2004 00:35:58 +0000 (00:35 +0000)
committerMichael Poole <mdpoole@troilus.org>
Wed, 25 Aug 2004 00:35:58 +0000 (00:35 +0000)
git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@1099 c9e4aea6-c8fd-4c43-8297-357d70d61c8c

ChangeLog
include/client.h

index f76382c76233ff0162579d83850af9df66945e7f..beb41152d61380e87c54324a0cf9695dd7b09a0b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2004-08-24  Michael Poole <mdpoole@troilus.org>
+
+       * ircd/client.h: Properly parenthesize "flag" argument to
+       FLAGSET_INDEX() and FLAGSET_MASK() macros.
+
 2004-08-22  Michael Poole <mdpoole@troilus.org>
 
        * ircd/channel.c (send_channel_modes): If oplevels are disabled,
index 14967911b5fffda3b4a2628ee0b80c1020232b83..28179902d21aa9be5d37111d924345d3dd3bcfc1 100644 (file)
@@ -67,8 +67,8 @@ struct AuthRequest;
 typedef unsigned long flagpage_t;
 
 #define FLAGSET_NBITS (8 * sizeof(flagpage_t))
-#define FLAGSET_INDEX(flag) (flag / FLAGSET_NBITS)
-#define FLAGSET_MASK(flag) (1<<(flag % FLAGSET_NBITS))
+#define FLAGSET_INDEX(flag) ((flag) / FLAGSET_NBITS)
+#define FLAGSET_MASK(flag) (1<<((flag) % FLAGSET_NBITS))
 
 #define DECLARE_FLAGSET(name,max) \
   struct name \