commit 201932474168aabdd29391328361f1cc5117aac6 from: Alexander Barton date: Thu Aug 25 09:04:23 2005 UTC Fixed format string bug in "connection statistics" message [from HEAD]. commit - 99e718eff96ad124adf06a5712a23b7a02537693 commit + 201932474168aabdd29391328361f1cc5117aac6 blob - 4aafb1400cf576cec28f14c1ac4615ee81b4f4e2 blob + 3f1fa08da900175293166f66db963792541fade2 --- ChangeLog +++ ChangeLog @@ -8,7 +8,11 @@ terms of the GNU General Public License. -- ChangeLog -- + + +ngIRCd 0.9.x + - Fixed a format string bug in "connection statistics" messages to clients. ngIRCd 0.9.1 (2005-08-03) @@ -620,4 +624,4 @@ ngIRCd 0.0.1, 31.12.2001 -- -$Id: ChangeLog,v 1.276.2.7 2005/08/03 14:27:48 alex Exp $ +$Id: ChangeLog,v 1.276.2.8 2005/08/25 09:04:23 alex Exp $ blob - f3059186d73f1c1cbecffc4ed9a8f63dfd574966 blob + 258885ecc7f829a9bf06d01f2d6b81ecb5db78f8 --- src/ngircd/conn.c +++ src/ngircd/conn.c @@ -16,7 +16,7 @@ #include "portab.h" -static char UNUSED id[] = "$Id: conn.c,v 1.155.2.1 2005/07/02 14:45:07 alex Exp $"; +static char UNUSED id[] = "$Id: conn.c,v 1.155.2.2 2005/08/25 09:04:23 alex Exp $"; #include "imp.h" #include @@ -694,19 +694,23 @@ Conn_Close( CONN_ID Idx, char *LogMsg, char *FwdMsg, b c = Client_GetFromConn( Idx ); /* Should the client be informed? */ - if( InformClient ) - { + if (InformClient) { #ifndef STRICT_RFC /* Send statistics to client if registered as user: */ - if(( c != NULL ) && ( Client_Type( c ) == CLIENT_USER )) - { - Conn_WriteStr( Idx, "NOTICE %s :%sConnection statistics: client %.1f kb, server %.1f kb.", Client_ThisServer( ), NOTICE_TXTPREFIX, (double)My_Connections[Idx].bytes_in / 1024, (double)My_Connections[Idx].bytes_out / 1024 ); + if ((c != NULL) && (Client_Type(c) == CLIENT_USER)) { + Conn_WriteStr( Idx, + "NOTICE %s :%sConnection statistics: client %.1f kb, server %.1f kb.", + Client_ID(Client_ThisServer()), NOTICE_TXTPREFIX, + (double)My_Connections[Idx].bytes_in / 1024, + (double)My_Connections[Idx].bytes_out / 1024); } #endif /* Send ERROR to client (see RFC!) */ - if( FwdMsg ) Conn_WriteStr( Idx, "ERROR :%s", FwdMsg ); - else Conn_WriteStr( Idx, "ERROR :Closing connection." ); + if (FwdMsg) + Conn_WriteStr(Idx, "ERROR :%s", FwdMsg); + else + Conn_WriteStr(Idx, "ERROR :Closing connection."); } /* Try to write out the write buffer */