]> arthur.barton.de Git - ngircd.git/commitdiff
Fixed format string bug in "connection statistics" message [from HEAD].
authorAlexander Barton <alex@barton.de>
Thu, 25 Aug 2005 09:04:23 +0000 (09:04 +0000)
committerAlexander Barton <alex@barton.de>
Thu, 25 Aug 2005 09:04:23 +0000 (09:04 +0000)
ChangeLog
src/ngircd/conn.c

index 4aafb1400cf576cec28f14c1ac4615ee81b4f4e2..3f1fa08da900175293166f66db963792541fade2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
                                -- ChangeLog --
 
 
+ngIRCd 0.9.x
+
+  - Fixed a format string bug in "connection statistics" messages to clients.
+
 ngIRCd 0.9.1 (2005-08-03)
 
   - The KILL command killed much more than desired (including server links!)
@@ -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 $
index f3059186d73f1c1cbecffc4ed9a8f63dfd574966..258885ecc7f829a9bf06d01f2d6b81ecb5db78f8 100644 (file)
@@ -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 <assert.h>
@@ -694,19 +694,23 @@ Conn_Close( CONN_ID Idx, char *LogMsg, char *FwdMsg, bool InformClient )
        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 */