Message handlers should return void.
Also fix up some return values and stuff to use bool (or void if nothing). I just did it whilst I was here. According to jilles, the return value used to signify whether or not the client had exited. This was error-prone and was fixed a long, long time ago, but the return value was left int for historical reasons. Since the return type is not used (and has no clear use case anyway), it's safe to just get rid of it.
This commit is contained in:
parent
eeabf33a7c
commit
3c7d6fcce7
99 changed files with 1339 additions and 1691 deletions
|
@ -46,11 +46,12 @@
|
|||
#include "parse.h"
|
||||
#include "modules.h"
|
||||
|
||||
static void mo_testmask(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p,
|
||||
int parc, const char *parv[]);
|
||||
static const char testmask_desc[] =
|
||||
"Provides the TESTMASK command to show the number of clients matching a hostmask or GECOS";
|
||||
|
||||
static void mo_testmask(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p,
|
||||
int parc, const char *parv[]);
|
||||
|
||||
struct Message testmask_msgtab = {
|
||||
"TESTMASK", 0, 0, 0, 0,
|
||||
{mg_unreg, mg_not_oper, mg_ignore, mg_ignore, mg_ignore, {mo_testmask, 2}}
|
||||
|
@ -62,7 +63,7 @@ DECLARE_MODULE_AV2(testmask, NULL, NULL, testmask_clist, NULL, NULL, NULL, NULL,
|
|||
static const char *empty_sockhost = "255.255.255.255";
|
||||
static const char *spoofed_sockhost = "0";
|
||||
|
||||
static int
|
||||
static void
|
||||
mo_testmask(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p,
|
||||
int parc, const char *parv[])
|
||||
{
|
||||
|
@ -81,7 +82,7 @@ mo_testmask(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *sou
|
|||
if((hostname = strchr(name, '@')) == NULL)
|
||||
{
|
||||
sendto_one_notice(source_p, ":Invalid parameters");
|
||||
return 0;
|
||||
return;
|
||||
}
|
||||
|
||||
*hostname++ = '\0';
|
||||
|
@ -98,7 +99,7 @@ mo_testmask(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *sou
|
|||
if(EmptyString(username) || EmptyString(hostname))
|
||||
{
|
||||
sendto_one_notice(source_p, ":Invalid parameters");
|
||||
return 0;
|
||||
return;
|
||||
}
|
||||
|
||||
if(parc > 2 && !EmptyString(parv[2]))
|
||||
|
@ -143,5 +144,4 @@ mo_testmask(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *sou
|
|||
me.name, source_p->name,
|
||||
lcount, gcount, name ? name : "*",
|
||||
username, hostname, gecos ? gecos : "*");
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue