X-Git-Url: https://jfr.im/git/irc/quakenet/newserv.git/blobdiff_plain/0495c1d19a1a740857029cfad02c0cf279c88718..dfa6a3e6e932b35cf31f2cba948d45c41a703ac6:/whowas/whowas_commands.c diff --git a/whowas/whowas_commands.c b/whowas/whowas_commands.c index 946111ea..db688ae2 100644 --- a/whowas/whowas_commands.c +++ b/whowas/whowas_commands.c @@ -26,8 +26,8 @@ static int whowas_cmdwhowas(void *source, int cargc, char **cargv) { if (cargc > 1) limit = strtol(cargv[1], NULL, 10); - 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; @@ -38,9 +38,10 @@ static int whowas_cmdwhowas(void *source, int cargc, char **cargv) { if (match2strings(pattern, hostmask)) { matches++; - if (matches <= limit) + if (matches <= limit) { controlreply(sender, "%s", whowas_format(ww)); - else if (matches == limit + 1) + controlreply(sender, "%s", whowas_formatchannels(ww)); + } else if (matches == limit + 1) controlreply(sender, "--- More than %d matches, skipping the rest", limit); } } @@ -65,6 +66,7 @@ static int whowas_cmdwhowaschase(void *source, int cargc, char **cargv) { } controlreply(sender, "%s", whowas_format(ww)); + controlreply(sender, "%s", whowas_formatchannels(ww)); controlreply(sender, "Done."); return CMD_OK;