diff --git a/src/ngircd/channel.c b/src/ngircd/channel.c index 5e3b9a80..d05095bb 100644 --- a/src/ngircd/channel.c +++ b/src/ngircd/channel.c @@ -17,7 +17,7 @@ #include "portab.h" -static char UNUSED id[] = "$Id: channel.c,v 1.58 2006/10/02 21:55:49 fw Exp $"; +static char UNUSED id[] = "$Id: channel.c,v 1.59 2006/10/06 21:32:58 fw Exp $"; #include "imp.h" #include @@ -265,11 +265,11 @@ Channel_Quit( CLIENT *Client, char *Reason ) } /* Channel_Quit */ -GLOBAL long +GLOBAL unsigned long Channel_Count( void ) { CHANNEL *c; - long count = 0; + unsigned long count = 0; c = My_Channels; while( c ) @@ -281,11 +281,11 @@ Channel_Count( void ) } /* Channel_Count */ -GLOBAL long +GLOBAL unsigned long Channel_MemberCount( CHANNEL *Chan ) { CL2CHAN *cl2chan; - long count = 0; + unsigned long count = 0; assert( Chan != NULL ); @@ -339,8 +339,8 @@ Channel_PCount( void ) } /* Channel_PCount */ -GLOBAL char * -Channel_Name( CHANNEL *Chan ) +GLOBAL const char * +Channel_Name( const CHANNEL *Chan ) { assert( Chan != NULL ); return Chan->name; @@ -363,7 +363,7 @@ Channel_Key( CHANNEL *Chan ) } /* Channel_Key */ -GLOBAL long +GLOBAL unsigned long Channel_MaxUsers( CHANNEL *Chan ) { assert( Chan != NULL ); @@ -687,7 +687,7 @@ Channel_SetKey( CHANNEL *Chan, char *Key ) GLOBAL void -Channel_SetMaxUsers( CHANNEL *Chan, long Count ) +Channel_SetMaxUsers(CHANNEL *Chan, unsigned long Count) { assert( Chan != NULL ); @@ -714,7 +714,7 @@ Channel_Write( CHANNEL *Chan, CLIENT *From, CLIENT *Client, char *Text ) ok = true; if( strchr( Channel_Modes( Chan ), 'n' ) && ( ! is_member )) ok = false; if( strchr( Channel_Modes( Chan ), 'm' ) && ( ! is_op ) && ( ! has_voice )) ok = false; - + /* Is the client banned? */ if( Lists_CheckBanned( From, Chan )) { diff --git a/src/ngircd/channel.h b/src/ngircd/channel.h index 3dc3c590..e6e3d40e 100644 --- a/src/ngircd/channel.h +++ b/src/ngircd/channel.h @@ -8,7 +8,7 @@ * (at your option) any later version. * Please read the file COPYING, README and AUTHORS for more information. * - * $Id: channel.h,v 1.30 2006/10/02 21:55:50 fw Exp $ + * $Id: channel.h,v 1.31 2006/10/06 21:32:58 fw Exp $ * * Channel management (header) */ @@ -35,7 +35,7 @@ typedef struct _CHANNEL char topic_who[CLIENT_NICK_LEN];/* Nickname of user that set topic */ #endif char key[CLIENT_PASS_LEN]; /* Channel key ("password", mode "k" ) */ - long maxusers; /* Maximum number of members (mode "l") */ + unsigned long maxusers; /* Maximum number of members (mode "l") */ } CHANNEL; typedef struct _CLIENT2CHAN @@ -65,21 +65,21 @@ GLOBAL void Channel_Quit PARAMS(( CLIENT *Client, char *Reason )); GLOBAL void Channel_Kick PARAMS(( CLIENT *Client, CLIENT *Origin, char *Name, char *Reason )); -GLOBAL long Channel_Count PARAMS(( void )); -GLOBAL long Channel_MemberCount PARAMS(( CHANNEL *Chan )); +GLOBAL unsigned long Channel_Count PARAMS(( void )); +GLOBAL unsigned long Channel_MemberCount PARAMS(( CHANNEL *Chan )); GLOBAL int Channel_CountForUser PARAMS(( CLIENT *Client )); GLOBAL int Channel_PCount PARAMS(( void )); -GLOBAL char *Channel_Name PARAMS(( CHANNEL *Chan )); +GLOBAL const char *Channel_Name PARAMS(( const CHANNEL *Chan )); GLOBAL char *Channel_Modes PARAMS(( CHANNEL *Chan )); GLOBAL char *Channel_Topic PARAMS(( CHANNEL *Chan )); GLOBAL char *Channel_Key PARAMS(( CHANNEL *Chan )); -GLOBAL long Channel_MaxUsers PARAMS(( CHANNEL *Chan )); +GLOBAL unsigned long Channel_MaxUsers PARAMS(( CHANNEL *Chan )); GLOBAL void Channel_SetTopic PARAMS(( CHANNEL *Chan, CLIENT *Client, char *Topic )); GLOBAL void Channel_SetModes PARAMS(( CHANNEL *Chan, char *Modes )); GLOBAL void Channel_SetKey PARAMS(( CHANNEL *Chan, char *Key )); -GLOBAL void Channel_SetMaxUsers PARAMS(( CHANNEL *Chan, long Count )); +GLOBAL void Channel_SetMaxUsers PARAMS(( CHANNEL *Chan, unsigned long Count )); GLOBAL CHANNEL *Channel_Search PARAMS(( char *Name )); diff --git a/src/ngircd/irc-channel.c b/src/ngircd/irc-channel.c index f0b89f8c..f30df91a 100644 --- a/src/ngircd/irc-channel.c +++ b/src/ngircd/irc-channel.c @@ -14,7 +14,7 @@ #include "portab.h" -static char UNUSED id[] = "$Id: irc-channel.c,v 1.36 2006/10/05 18:26:54 fw Exp $"; +static char UNUSED id[] = "$Id: irc-channel.c,v 1.37 2006/10/06 21:32:58 fw Exp $"; #include "imp.h" #include @@ -491,7 +491,7 @@ IRC_CHANINFO( CLIENT *Client, REQUEST *Req ) { if( *ptr == 'l' ) { - snprintf( l, sizeof( l ), " %ld", Channel_MaxUsers( chan )); + snprintf( l, sizeof( l ), " %lu", Channel_MaxUsers( chan )); strlcat( modes_add, l, sizeof( modes_add )); } if( *ptr == 'k' ) diff --git a/src/ngircd/irc-info.c b/src/ngircd/irc-info.c index 396d62e9..ac9e9d80 100644 --- a/src/ngircd/irc-info.c +++ b/src/ngircd/irc-info.c @@ -14,7 +14,7 @@ #include "portab.h" -static char UNUSED id[] = "$Id: irc-info.c,v 1.35 2006/10/01 19:13:32 alex Exp $"; +static char UNUSED id[] = "$Id: irc-info.c,v 1.36 2006/10/06 21:32:58 fw Exp $"; #include "imp.h" #include @@ -542,7 +542,8 @@ GLOBAL bool IRC_WHO( CLIENT *Client, REQUEST *Req ) { bool ok, only_ops; - char flags[8], *ptr; + char flags[8]; + const char *ptr; CL2CHAN *cl2chan; CHANNEL *chan, *cn; CLIENT *c; diff --git a/src/ngircd/irc-mode.c b/src/ngircd/irc-mode.c index fa373081..038e13df 100644 --- a/src/ngircd/irc-mode.c +++ b/src/ngircd/irc-mode.c @@ -14,7 +14,7 @@ #include "portab.h" -static char UNUSED id[] = "$Id: irc-mode.c,v 1.46 2006/08/12 11:56:24 fw Exp $"; +static char UNUSED id[] = "$Id: irc-mode.c,v 1.47 2006/10/06 21:32:58 fw Exp $"; #include "imp.h" #include @@ -268,7 +268,7 @@ Channel_Mode( CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel ) switch( *mode_ptr ) { case 'l': - snprintf( argadd, sizeof( argadd ), " %ld", Channel_MaxUsers( Channel )); + snprintf( argadd, sizeof( argadd ), " %lu", Channel_MaxUsers( Channel )); strlcat( the_args, argadd, sizeof( the_args )); break; case 'k': diff --git a/src/ngircd/irc-server.c b/src/ngircd/irc-server.c index b8681b9c..3d64e1fe 100644 --- a/src/ngircd/irc-server.c +++ b/src/ngircd/irc-server.c @@ -14,7 +14,7 @@ #include "portab.h" -static char UNUSED id[] = "$Id: irc-server.c,v 1.40 2006/10/01 19:05:02 alex Exp $"; +static char UNUSED id[] = "$Id: irc-server.c,v 1.41 2006/10/06 21:32:58 fw Exp $"; #include "imp.h" #include @@ -215,7 +215,13 @@ IRC_SERVER( CLIENT *Client, REQUEST *Req ) else { /* "CHANINFO + :" */ - if( ! IRC_WriteStrClient( Client, "CHANINFO %s +%s %s %ld :%s", Channel_Name( chan ), modes, strchr( Channel_Modes( chan ), 'k' ) ? Channel_Key( chan ) : "*", strchr( Channel_Modes( chan ), 'l' ) ? Channel_MaxUsers( chan ) : 0L, topic )) return DISCONNECTED; + if( ! IRC_WriteStrClient( Client, "CHANINFO %s +%s %s %lu :%s", + Channel_Name( chan ), modes, + strchr( Channel_Modes( chan ), 'k' ) ? Channel_Key( chan ) : "*", + strchr( Channel_Modes( chan ), 'l' ) ? Channel_MaxUsers( chan ) : 0UL, topic )) + { + return DISCONNECTED; + } } } } diff --git a/src/ngircd/messages.h b/src/ngircd/messages.h index aed2d252..bc68373b 100644 --- a/src/ngircd/messages.h +++ b/src/ngircd/messages.h @@ -8,7 +8,7 @@ * (at your option) any later version. * Please read the file COPYING, README and AUTHORS for more information. * - * $Id: messages.h,v 1.69 2006/10/01 19:13:32 alex Exp $ + * $Id: messages.h,v 1.70 2006/10/06 21:32:58 fw Exp $ * * IRC numerics (Header) */ @@ -35,7 +35,7 @@ #define RPL_LUSERCLIENT_MSG "251 %s :There are %ld users and %ld services on %ld servers" #define RPL_LUSEROP_MSG "252 %s %ld :operator(s) online" #define RPL_LUSERUNKNOWN_MSG "253 %s %ld :unknown connection(s)" -#define RPL_LUSERCHANNELS_MSG "254 %s %ld :channels formed" +#define RPL_LUSERCHANNELS_MSG "254 %s %lu :channels formed" #define RPL_LUSERME_MSG "255 %s :I have %ld users, %ld services and %ld servers" #define RPL_ADMINME_MSG "256 %s %s :Administrative info" #define RPL_ADMINLOC1_MSG "257 %s :%s"