]> jfr.im git - irc/quakenet/newserv.git/blobdiff - newsearch/newsearch.c
CHANSERV: reduce reason to 15 chars
[irc/quakenet/newserv.git] / newsearch / newsearch.c
index 969a45938bd434dbe591ce6554004c54a493d190..3d4e46f93ad8a74cd865fdd251ef0b0802259b64 100644 (file)
@@ -308,6 +308,7 @@ void _fini() {
   deregistersearchcommand( reg_nicksearch );
   deregistersearchcommand( reg_chansearch );
   deregistersearchcommand( reg_usersearch );
+  deregistersearchcommand( reg_whowassearch );
   destroycommandtree( searchCmdTree );
 }
 
@@ -327,6 +328,8 @@ void registerglobalsearchterm(char *term, parseFunc parsefunc, char *help) {
     int len=strlen(help);
     sl->help=(char *)malloc(len+1);
     if(!sl->help) {
+      freesstring(sl->name);
+      free(sl);
       Error("newsearch", ERR_ERROR, "malloc failed: registerglobalsearchterm");
       return;
     }
@@ -386,7 +389,7 @@ void deregistersearchterm(searchCmd *cmd, char *term, parseFunc parsefunc) {
   deletecommandfromtree(cmd->searchtree, term, (CommandHandler) parsefunc);
 }
 
-static void controlwallwrapper(int level, char *format, ...) __attribute__ ((format (printf, 2,         3)));
+static void controlwallwrapper(int level, char *format, ...) __attribute__ ((format (printf, 2, 3)));
 static void controlwallwrapper(int level, char *format, ...) {
   char buf[1024];
   va_list ap;
@@ -631,8 +634,8 @@ void whowassearch_exe(struct searchNode *search, searchCtx *ctx) {
   /* The top-level node needs to return a BOOL */
   search=coerceNode(ctx, search, RETURNTYPE_BOOL);
 
-  for (i = whowasoffset; i < whowasoffset + WW_MAXENTRIES; i++) {
-    ww = &whowasrecs[i % WW_MAXENTRIES];
+  for (i = whowasoffset; i < whowasoffset + whowasmax; i++) {
+    ww = &whowasrecs[i % whowasmax];
 
     if (ww->type == WHOWAS_UNUSED)
       continue;