]> jfr.im git - solanum.git/blobdiff - modules/m_stats.c
travis: Compile with warnings as errors
[solanum.git] / modules / m_stats.c
index d67348e6bd87156ffb531c75341d6e0b5dbd91a3..af43314660fe9ac0c66513c3149eecff9c08a0c1 100644 (file)
@@ -46,6 +46,7 @@
 #include "whowas.h"
 #include "rb_radixtree.h"
 #include "sslproc.h"
+#include "s_assert.h"
 
 static const char stats_desc[] =
        "Provides the STATS command to inspect various server/network information";
@@ -314,7 +315,7 @@ stats_hash(struct Client *source_p)
 static void
 stats_connect(struct Client *source_p)
 {
-       static char buf[5];
+       static char buf[BUFSIZE];
        struct server_conf *server_p;
        char *s;
        rb_dlink_node *ptr;
@@ -341,6 +342,8 @@ stats_connect(struct Client *source_p)
                {
                        if(ServerConfAutoconn(server_p))
                                *s++ = 'A';
+                       if(ServerConfSCTP(server_p))
+                               *s++ = 'M';
                        if(ServerConfSSL(server_p))
                                *s++ = 'S';
                        if(ServerConfTb(server_p))
@@ -625,7 +628,7 @@ stats_tklines(struct Client *source_p)
                get_printable_kline(source_p, aconf, &host, &pass, &user, &oper_reason);
 
                sendto_one_numeric(source_p, RPL_STATSKLINE,
-                                  form_str(RPL_STATSKLINE), aconf->flags & CONF_FLAGS_TEMPORARY ? 'k' : 'K',
+                                  form_str(RPL_STATSKLINE), (aconf->flags & CONF_FLAGS_TEMPORARY) ? 'k' : 'K',
                                   host, user, pass, oper_reason ? "|" : "",
                                   oper_reason ? oper_reason : "");
        }
@@ -724,7 +727,7 @@ stats_klines(struct Client *source_p)
                get_printable_kline(source_p, aconf, &host, &pass, &user, &oper_reason);
 
                sendto_one_numeric(source_p, RPL_STATSKLINE, form_str(RPL_STATSKLINE),
-                                  aconf->flags & CONF_FLAGS_TEMPORARY ? 'k' : 'K',
+                                  (aconf->flags & CONF_FLAGS_TEMPORARY) ? 'k' : 'K',
                                   host, user, pass, oper_reason ? "|" : "",
                                   oper_reason ? oper_reason : "");
        }
@@ -738,7 +741,6 @@ stats_messages(struct Client *source_p)
 {
        rb_dictionary_iter iter;
        struct Message *msg;
-       struct alias_entry *amsg;
 
        RB_DICTIONARY_FOREACH(msg, &iter, cmd_dict)
        {
@@ -756,6 +758,9 @@ stats_dnsbl(struct Client *source_p)
        rb_dictionary_iter iter;
        struct BlacklistStats *stats;
 
+       if(bl_stats == NULL)
+               return;
+
        RB_DICTIONARY_FOREACH(stats, &iter, bl_stats)
        {
                /* use RPL_STATSDEBUG for now -- jilles */
@@ -825,7 +830,7 @@ stats_operedup (struct Client *source_p)
        {
                target_p = oper_ptr->data;
 
-               if(IsOperInvis(target_p) && !IsOper(source_p))
+               if(!SeesOper(target_p, source_p))
                        continue;
 
                if(target_p->user->away)