summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS2
-rw-r--r--modules/m_stats.c8
2 files changed, 7 insertions, 3 deletions
diff --git a/NEWS b/NEWS
index b8bba0c..4e8c3c3 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,7 @@
-- Noteworthy changes in version 8.1.18 (????-??-??)
o) Fixed CAP issue for certain clients
+o) Fixed bug where "STATS p" would show an invalid amount of irc-operators
+ in case there are +H opers
-- Noteworthy changes in version 8.1.17 (2014-05-01)
diff --git a/modules/m_stats.c b/modules/m_stats.c
index 023251c..1be798e 100644
--- a/modules/m_stats.c
+++ b/modules/m_stats.c
@@ -1109,7 +1109,8 @@ stats_oper(struct Client *source_p, int parc, char *parv[])
static void
stats_operedup(struct Client *source_p, int parc, char *parv[])
{
- dlink_node *ptr;
+ dlink_node *ptr = NULL;
+ unsigned int opercount = 0;
DLINK_FOREACH(ptr, oper_list.head)
{
@@ -1129,12 +1130,13 @@ stats_operedup(struct Client *source_p, int parc, char *parv[])
sendto_one(source_p, ":%s %d %s p :[%c] %s (%s@%s) Idle: %u",
from, RPL_STATSDEBUG, to,
HasUMode(target_p, UMODE_ADMIN) ? 'A' : 'O',
- target_p->name, target_p->username, target_p->host,
+ target_p->name, target_p->username, target_p->host,
idle_time_get(source_p, target_p));
+ ++opercount;
}
sendto_one(source_p, ":%s %d %s p :%u OPER(s)",
- from, RPL_STATSDEBUG, to, dlink_list_length(&oper_list));
+ from, RPL_STATSDEBUG, to, opercount);
}
static void