summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/operserv.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/operserv.c b/src/operserv.c
index ab0e90ea9..ab68d0409 100644
--- a/src/operserv.c
+++ b/src/operserv.c
@@ -2521,7 +2521,7 @@ int add_sgline(User * u, char *mask, const char *by, const time_t expires,
int deleted = 0, i;
int x;
SXLine *entry;
- User *u2;
+ User *u2, *next;
char buf[BUFSIZE];
*buf = '\0';
@@ -2600,14 +2600,14 @@ int add_sgline(User * u, char *mask, const char *by, const time_t expires,
anope_cmd_sgline(entry->mask, entry->reason);
if (KillonSGline && !ircd->sglineenforce) {
- for (x = 0; x < 1024; x++) {
- for (u2 = userlist[x]; u2; u2 = u2->next) {
- if (match_wild_nocase(entry->mask, u2->realname)) {
- snprintf(buf, BUFSIZE - 1, "G-Lined: %s",
- entry->reason);
- kill_user(ServerName, u2->nick, buf);
- }
+ u2 = firstuser();
+ while (u2) {
+ next = nextuser();
+ if (match_wild_nocase(entry->mask, u2->realname)) {
+ snprintf(buf, (BUFSIZE - 1), "G-Lined: %s", entry->reason);
+ kill_user(ServerName, u2->nick, buf);
}
+ u2 = next;
}
}
return deleted;
@@ -2988,7 +2988,7 @@ int add_sqline(User * u, char *mask, const char *by, const time_t expires,
{
int deleted = 0, i;
int x;
- User *u2;
+ User *u2, *next;
SXLine *entry;
char buf[BUFSIZE];
*buf = '\0';
@@ -3072,14 +3072,14 @@ int add_sqline(User * u, char *mask, const char *by, const time_t expires,
sqline(entry->mask, entry->reason);
if (KillonSQline) {
- for (x = 0; x < 1024; x++) {
- for (u2 = userlist[x]; u2; u2 = u2->next) {
- if (match_wild_nocase(entry->mask, u2->nick)) {
- snprintf(buf, BUFSIZE - 1, "Q-Lined: %s",
- entry->reason);
- kill_user(ServerName, u2->nick, buf);
- }
+ u2 = firstuser();
+ while (u2) {
+ next = nextuser();
+ if (match_wild_nocase(entry->mask, u2->nick)) {
+ snprintf(buf, (BUFSIZE - 1), "Q-Lined: %s", entry->reason);
+ kill_user(ServerName, u2->nick, buf);
}
+ u2 = next;
}
}