]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/irc-info.c
channel maxusers now unsigned long
[ngircd-alex.git] / src / ngircd / irc-info.c
index 48d447ca4fb1f1124bb38b0d47e02f975775be03..ac9e9d805ae790700f45a85931775804c53b3476 100644 (file)
@@ -14,7 +14,7 @@
 
 #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>
@@ -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;
@@ -833,6 +834,9 @@ GLOBAL bool
 IRC_Send_LUSERS( CLIENT *Client )
 {
        long cnt;
+#ifndef STRICT_RFC
+       long max;
+#endif
 
        assert( Client != NULL );
 
@@ -861,9 +865,17 @@ IRC_Send_LUSERS( CLIENT *Client )
 
 #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;
@@ -910,10 +922,12 @@ IRC_Show_MOTD( CLIENT *Client )
                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)) {