- for (cip=chantable[i];cip;cip=ncip) {
- ncip = cip->next;
- if (cip != NULL && cip->channel != NULL && cip->marker == localdata->marker) {
- for (j=0;j<cip->channel->users->hashsize;j++) {
- if (cip->channel->users->content[j]==nouser)
- continue;
-
- if ((np=getnickbynumeric(cip->channel->users->content[j]))) {
- if (!IsOper(np) && !IsService(np) && !IsXOper(np)) {
- killuser(NULL, np, "You (%s!%s@%s) have been disconnected for violating our terms of service%s", np->nick,
- np->ident, IPtostr(np->p_ipaddr), localdata->reason);
- }
- else
- safe++;
- }
- }
+ for (cip=chantable[i];cip;cip=cip->next) {
+ /* Skip empty and non-matching channels */
+ if (!cip->channel || cip->marker != localdata->marker)
+ continue;
+
+ for (j=0;j<cip->channel->users->hashsize;j++) {
+ if (cip->channel->users->content[j]==nouser)
+ continue;
+
+ if ((np=getnickbynumeric(cip->channel->users->content[j])))
+ np->marker=nickmarker;