]> arthur.barton.de Git - ngircd.git/blobdiff - src/ngircd/irc-info.c
- Adjusted includes for new "conn-func.h" header.
[ngircd.git] / src / ngircd / irc-info.c
index 9a4efb679aa30e26ecc14bfe6d04fd953e2a8d88..3ce821a275e3d20205c659a141fcaa827c14cb95 100644 (file)
@@ -14,7 +14,7 @@
 
 #include "portab.h"
 
-static char UNUSED id[] = "$Id: irc-info.c,v 1.10 2002/12/26 16:48:14 alex Exp $";
+static char UNUSED id[] = "$Id: irc-info.c,v 1.13 2002/12/30 17:15:42 alex Exp $";
 
 #include "imp.h"
 #include <assert.h>
@@ -23,7 +23,8 @@ static char UNUSED id[] = "$Id: irc-info.c,v 1.10 2002/12/26 16:48:14 alex Exp $
 #include <string.h>
 
 #include "ngircd.h"
-#include "conn.h"
+#include "conn-func.h"
+#include "conn-zip.h"
 #include "client.h"
 #include "channel.h"
 #include "resolve.h"
@@ -296,7 +297,7 @@ IRC_NAMES( CLIENT *Client, REQUEST *Req )
 
        /* Nun noch alle Clients ausgeben, die in keinem Channel sind */
        c = Client_First( );
-       sprintf( rpl, RPL_NAMREPLY_MSG, Client_ID( from ), "*", "*" );
+       snprintf( rpl, sizeof( rpl ), RPL_NAMREPLY_MSG, Client_ID( from ), "*", "*" );
        while( c )
        {
                if(( Client_Type( c ) == CLIENT_USER ) && ( Channel_FirstChannelOf( c ) == NULL ) && ( ! strchr( Client_Modes( c ), 'i' )))
@@ -309,7 +310,7 @@ IRC_NAMES( CLIENT *Client, REQUEST *Req )
                        {
                                /* Zeile wird zu lang: senden! */
                                if( ! IRC_WriteStrClient( from, "%s", rpl )) return DISCONNECTED;
-                               sprintf( rpl, RPL_NAMREPLY_MSG, Client_ID( from ), "*", "*" );
+                               snprintf( rpl, sizeof( rpl ), RPL_NAMREPLY_MSG, Client_ID( from ), "*", "*" );
                        }
                }
 
@@ -375,7 +376,7 @@ IRC_STATS( CLIENT *Client, REQUEST *Req )
 #ifdef USE_ZLIB
                                        if( Conn_Options( con ) & CONN_ZIP )
                                        {
-                                               if( ! IRC_WriteStrClient( from, RPL_STATSLINKINFOZIP_MSG, Client_ID( from ), Client_Mask( cl ), Conn_SendQ( con ), Conn_SendMsg( con ), Conn_SendBytesZip( con ), Conn_SendBytes( con ), Conn_RecvMsg( con ), Conn_RecvBytesZip( con ), Conn_RecvBytes( con ), (LONG)( time( NULL ) - Conn_StartTime( con )))) return DISCONNECTED;
+                                               if( ! IRC_WriteStrClient( from, RPL_STATSLINKINFOZIP_MSG, Client_ID( from ), Client_Mask( cl ), Conn_SendQ( con ), Conn_SendMsg( con ), Zip_SendBytes( con ), Conn_SendBytes( con ), Conn_RecvMsg( con ), Zip_RecvBytes( con ), Conn_RecvBytes( con ), (LONG)( time( NULL ) - Conn_StartTime( con )))) return DISCONNECTED;
                                        }
                                        else
 #endif
@@ -636,7 +637,7 @@ IRC_WHOIS( CLIENT *Client, REQUEST *Req )
        if( ! IRC_WriteStrClient( from, RPL_WHOISSERVER_MSG, Client_ID( from ), Client_ID( c ), Client_ID( Client_Introducer( c )), Client_Info( Client_Introducer( c )))) return DISCONNECTED;
 
        /* Channels */
-       sprintf( str, RPL_WHOISCHANNELS_MSG, Client_ID( from ), Client_ID( c ));
+       snprintf( str, sizeof( str ), RPL_WHOISCHANNELS_MSG, Client_ID( from ), Client_ID( c ));
        cl2chan = Channel_FirstChannelOf( c );
        while( cl2chan )
        {
@@ -653,7 +654,7 @@ IRC_WHOIS( CLIENT *Client, REQUEST *Req )
                {
                        /* Zeile wird zu lang: senden! */
                        if( ! IRC_WriteStrClient( Client, "%s", str )) return DISCONNECTED;
-                       sprintf( str, RPL_WHOISCHANNELS_MSG, Client_ID( from ), Client_ID( c ));
+                       snprintf( str, sizeof( str ), RPL_WHOISCHANNELS_MSG, Client_ID( from ), Client_ID( c ));
                }
 
                /* naechstes Mitglied suchen */
@@ -794,7 +795,7 @@ IRC_Send_NAMES( CLIENT *Client, CHANNEL *Chan )
        else is_member = FALSE;
 
        /* Alle Mitglieder suchen */
-       sprintf( str, RPL_NAMREPLY_MSG, Client_ID( Client ), "=", Channel_Name( Chan ));
+       snprintf( str, sizeof( str ), RPL_NAMREPLY_MSG, Client_ID( Client ), "=", Channel_Name( Chan ));
        cl2chan = Channel_FirstMember( Chan );
        while( cl2chan )
        {
@@ -815,7 +816,7 @@ IRC_Send_NAMES( CLIENT *Client, CHANNEL *Chan )
                        {
                                /* Zeile wird zu lang: senden! */
                                if( ! IRC_WriteStrClient( Client, "%s", str )) return DISCONNECTED;
-                               sprintf( str, RPL_NAMREPLY_MSG, Client_ID( Client ), "=", Channel_Name( Chan ));
+                               snprintf( str, sizeof( str ), RPL_NAMREPLY_MSG, Client_ID( Client ), "=", Channel_Name( Chan ));
                        }
                }