]> jfr.im git - irc/quakenet/newserv.git/commitdiff
Check for duplicate nicks in servertables or nicktable.
authorsplidge <redacted>
Thu, 10 Apr 2008 09:55:41 +0000 (10:55 +0100)
committersplidge <redacted>
Thu, 10 Apr 2008 09:55:41 +0000 (10:55 +0100)
fsck/fsck.c

index 1f5bda035f42e8434b4ec75aefa48aba88e6bc4a..9c7355e054d7f25b305968c261bf2a547bf2567a 100644 (file)
@@ -41,6 +41,11 @@ int dofsck(void *source, int cargc, char **cargv) {
   
   for (i=0;i<NICKHASHSIZE;i++) {
     for(np=nicktable[i];np;np=np->next) {
+      if (np->marker==nickmarker) {
+        controlreply(sender, "ERROR: bumped into the same nick %s/%s twice in hash table.",longtonumeric(np->numeric,5),np->nick);
+        errors++;
+      }
+      
       /* Mark this nick so we can check we found them all */
       np->marker=nickmarker;
 
@@ -136,6 +141,7 @@ int dofsck(void *source, int cargc, char **cargv) {
                         longtonumeric(np->numeric,5),np->nick);
            errors++;
          }
+         np->marker=0;
        }
       }
     }