]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Tweak to IS_LOCAL macro to exclude invalid fd's that are > MAX_DESCRIPTORS
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Fri, 30 Jun 2006 18:20:27 +0000 (18:20 +0000)
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Fri, 30 Jun 2006 18:20:27 +0000 (18:20 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4091 e03df62e-2008-0410-955e-edbf42e46eb7

include/modules.h

index d303f7c727b136064f64eaba8435d9cf4b3f058d..25e309f5569df9ec4e8be73739faf7f2db9e2153 100644 (file)
@@ -144,7 +144,7 @@ typedef std::map<std::string,Module*> featurelist;
 
 // useful macros
 
-#define IS_LOCAL(x) (x->fd > -1)
+#define IS_LOCAL(x) ((x->fd > -1) && (x->fd <= MAX_DESCRIPTORS))
 #define IS_REMOTE(x) (x->fd < 0)
 #define IS_MODULE_CREATED(x) (x->fd == FD_MAGIC_NUMBER)