]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/irc-info.c
Changed Numerics 265 and 266 to follow ircd 2.11.x "standards".
[ngircd-alex.git] / src / ngircd / irc-info.c
index 45fc814d33076712895b556a59e65df41cdcb184..396d62e9df7f6dcbd3b539b6e76fcaed67a74e72 100644 (file)
@@ -14,7 +14,7 @@
 
 #include "portab.h"
 
-static char UNUSED id[] = "$Id: irc-info.c,v 1.31 2006/01/27 17:19:58 fw Exp $";
+static char UNUSED id[] = "$Id: irc-info.c,v 1.35 2006/10/01 19:13:32 alex Exp $";
 
 #include "imp.h"
 #include <assert.h>
@@ -377,7 +377,7 @@ IRC_STATS( CLIENT *Client, REQUEST *Req )
                        con = Conn_First( );
                        while( con != NONE )
                        {
-                               cl = Client_GetFromConn( con );
+                               cl = Conn_GetClient( con );
                                if( cl && (( Client_Type( cl ) == CLIENT_SERVER ) || ( cl == Client )))
                                {
                                        /* Server link or our own connection */
@@ -833,6 +833,9 @@ GLOBAL bool
 IRC_Send_LUSERS( CLIENT *Client )
 {
        long cnt;
+#ifndef STRICT_RFC
+       long max;
+#endif
 
        assert( Client != NULL );
 
@@ -861,9 +864,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 +921,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)) {