#include "portab.h"
-static char UNUSED id[] = "$Id: irc-info.c,v 1.32 2006/04/23 10:37:27 fw Exp $";
+static char UNUSED id[] = "$Id: irc-info.c,v 1.36 2006/10/06 21:32:58 fw Exp $";
#include "imp.h"
#include <assert.h>
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;
IRC_Send_LUSERS( CLIENT *Client )
{
long cnt;
+#ifndef STRICT_RFC
+ long max;
+#endif
assert( Client != NULL );
#ifndef STRICT_RFC
/* Maximum number of local users */
- if( ! IRC_WriteStrClient( Client, RPL_LOCALUSERS_MSG, Client_ID( Client ), Client_MyUserCount( ), Client_MyMaxUserCount( ))) return DISCONNECTED;
+ cnt = Client_MyUserCount();
+ max = Client_MyMaxUserCount();
+ if (! IRC_WriteStrClient(Client, RPL_LOCALUSERS_MSG, Client_ID(Client),
+ cnt, max, cnt, max))
+ return DISCONNECTED;
/* Maximum number of users in the network */
- if( ! IRC_WriteStrClient( Client, RPL_NETUSERS_MSG, Client_ID( Client ), Client_UserCount( ), Client_MaxUserCount( ))) return DISCONNECTED;
+ cnt = Client_UserCount();
+ max = Client_MaxUserCount();
+ if(! IRC_WriteStrClient(Client, RPL_NETUSERS_MSG, Client_ID(Client),
+ cnt, max, cnt, max))
+ return DISCONNECTED;
#endif
return CONNECTED;
return IRC_WriteStrClient( Client, ERR_NOMOTD_MSG, Client_ID( Client ) );
}
- if (!Show_MOTD_Start( Client ))
- return DISCONNECTED;
+ if (!Show_MOTD_Start( Client )) {
+ fclose(fd);
+ return false;
+ }
- while (fgets( line, sizeof( line ), fd )) {
+ while (fgets( line, (int)sizeof line, fd )) {
ngt_TrimLastChr( line, '\n');
if( ! Show_MOTD_Sendline( Client, line)) {