diff options
author | geniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b <geniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864> | 2006-03-07 15:27:35 +0000 |
---|---|---|
committer | geniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b <geniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864> | 2006-03-07 15:27:35 +0000 |
commit | 663b243c593f1beb713e97d248f7d6586777e777 (patch) | |
tree | 8ddd9eb2408e8b34ea6e95372f0536792f49e801 /src | |
parent | 0db8644763bda9346ccf593051dd0256cd8d917f (diff) |
BUILD : 1.7.13 (1006) BUGS : 468 NOTES : Fixed a counting issue in /os stats uplink and ran indent on src/core/os_uplink.c
git-svn-id: svn://svn.anope.org/anope/trunk@1006 31f1291d-b8d6-0310-a050-a5561fc1590b
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@731 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src')
-rw-r--r-- | src/core/os_stats.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/src/core/os_stats.c b/src/core/os_stats.c index 991d0a15d..a4e4f05bf 100644 --- a/src/core/os_stats.c +++ b/src/core/os_stats.c @@ -35,8 +35,7 @@ int AnopeInit(int argc, char **argv) Command *c; moduleAddAuthor("Anope"); - moduleAddVersion - ("$Id$"); + moduleAddVersion("$Id$"); moduleSetType(CORE); c = createCommand("STATS", do_stats, is_services_oper, OPER_HELP_STATS, @@ -78,9 +77,10 @@ void myOperServHelp(User * u) **/ int stats_count_servers(Server * s) { - int count = 1; + int count = 0; while (s) { + count++; if (s->links) count += stats_count_servers(s->links); s = s->next; @@ -234,9 +234,8 @@ int do_stats(User * u) } } - if (!extra - || ((stricmp(extra, "MEMORY") != 0) - && (stricmp(extra, "UPLINK") != 0))) { + if (!extra || ((stricmp(extra, "MEMORY") != 0) + && (stricmp(extra, "UPLINK") != 0))) { notice_lang(s_OperServ, u, OPER_STATS_CURRENT_USERS, usercnt, opcnt); tm = localtime(&maxusertime); @@ -310,9 +309,9 @@ int do_stats(User * u) } } - if (extra - && ((stricmp(extra, "ALL") == 0) - || (stricmp(extra, "UPLINK") == 0)) && is_services_admin(u)) { + if (extra && ((stricmp(extra, "ALL") == 0) + || (stricmp(extra, "UPLINK") == 0)) + && is_services_admin(u)) { buf[0] = '\0'; buflen = 511; /* How confusing, this is the amount of space left! */ for (i = 0; capab_info[i].token; i++) { @@ -331,10 +330,10 @@ int do_stats(User * u) if (capab_info[i].flag == CAPAB_NICKCHARS) { strncat(buf, "=", buflen); buflen--; - if(ircd->nickchars) { + if (ircd->nickchars) { strncat(buf, ircd->nickchars, buflen); buflen -= strlen(ircd->nickchars); - } /* leave blank if it was null */ + } /* leave blank if it was null */ } } } @@ -345,9 +344,9 @@ int do_stats(User * u) stats_count_servers(serv_uplink)); } - if (extra - && ((stricmp(extra, "ALL") == 0) - || (stricmp(extra, "MEMORY") == 0)) && is_services_admin(u)) { + if (extra && ((stricmp(extra, "ALL") == 0) + || (stricmp(extra, "MEMORY") == 0)) + && is_services_admin(u)) { long count, mem; notice_lang(s_OperServ, u, OPER_STATS_BYTES_READ, |