]> jfr.im git - irc/quakenet/newserv.git/commitdiff
fix core when using (kill) to newsearch
authorPaul <redacted>
Sun, 13 Jan 2008 20:38:43 +0000 (20:38 +0000)
committerPaul <redacted>
Sun, 13 Jan 2008 20:38:43 +0000 (20:38 +0000)
newsearch/ns-kill.c

index 4929bb1c71cbfd36b7f4df90f3012d3adf727c00..258a3b07fbc39f0c294eaabac08cde7433790fbb 100644 (file)
@@ -91,6 +91,7 @@ void kill_free(struct searchNode *thenode) {
   nick *np, *nnp;
   chanindex *cip, *ncip;
   int i, j, safe=0;
+  unsigned int nickmarker;
 
   localdata = thenode->localdata;
 
@@ -103,6 +104,7 @@ void kill_free(struct searchNode *thenode) {
   }
 
   if (localdata->type == SEARCHTYPE_CHANNEL) {
+    nickmarker=nextnickmarker();
     for (i=0;i<CHANNELHASHSIZE;i++) {
       for (cip=chantable[i];cip;cip=ncip) {
         ncip = cip->next;
@@ -113,8 +115,7 @@ void kill_free(struct searchNode *thenode) {
     
             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);
+                np->marker=nickmarker;
               }
               else
                 safe++;
@@ -123,6 +124,14 @@ void kill_free(struct searchNode *thenode) {
         }
       }
     }
+    for (i=0;i<NICKHASHSIZE;i++) {
+      for(np=nicktable[i];np;np=nnp) {
+        nnp = np->next;
+        if (np->marker == nickmarker) 
+          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 {
     for (i=0;i<NICKHASHSIZE;i++) {