mirror of
https://github.com/pissnet/angiosperm.git
synced 2025-07-31 16:42:23 +01:00
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
extensions
|
@ -17,9 +17,9 @@
|
|||
|
||||
const char mkpasswd_desc[] = "Hash a password for use in ircd.conf";
|
||||
|
||||
static int m_mkpasswd(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p,
|
||||
static void m_mkpasswd(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p,
|
||||
int parc, const char *parv[]);
|
||||
static int mo_mkpasswd(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p,
|
||||
static void mo_mkpasswd(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p,
|
||||
int parc, const char *parv[]);
|
||||
|
||||
static char *make_md5_salt(int);
|
||||
|
@ -45,7 +45,7 @@ DECLARE_MODULE_AV2(mkpasswd, NULL, NULL, mkpasswd_clist, NULL, NULL, NULL, NULL,
|
|||
* parv[1] = password
|
||||
* parv[2] = type
|
||||
*/
|
||||
static int
|
||||
static void
|
||||
m_mkpasswd(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
|
||||
{
|
||||
static time_t last_used = 0;
|
||||
|
@ -57,7 +57,7 @@ m_mkpasswd(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *sour
|
|||
if(EmptyString(parv[1]))
|
||||
{
|
||||
sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), me.name, source_p->name, "MKPASSWD");
|
||||
return 0;
|
||||
return;
|
||||
}
|
||||
|
||||
if(parc < 3)
|
||||
|
@ -69,7 +69,7 @@ m_mkpasswd(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *sour
|
|||
{
|
||||
/* safe enough to give this on a local connect only */
|
||||
sendto_one(source_p, form_str(RPL_LOAD2HI), me.name, source_p->name, "MKPASSWD");
|
||||
return 0;
|
||||
return;
|
||||
}
|
||||
else
|
||||
last_used = rb_current_time();
|
||||
|
@ -84,19 +84,18 @@ m_mkpasswd(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *sour
|
|||
{
|
||||
sendto_one_notice(source_p,
|
||||
":MKPASSWD syntax error: MKPASSWD pass [SHA256|SHA512|MD5]");
|
||||
return 0;
|
||||
return;
|
||||
}
|
||||
|
||||
crypted = rb_crypt(parv[1], salt);
|
||||
sendto_one_notice(source_p, ":Hash [%s] for %s: %s", hashtype, parv[1], crypted ? crypted : "???");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* mo_mkpasswd - mkpasswd message handler
|
||||
* parv[1] = password
|
||||
* parv[2] = type
|
||||
*/
|
||||
static int
|
||||
static void
|
||||
mo_mkpasswd(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
|
||||
{
|
||||
char *salt;
|
||||
|
@ -107,7 +106,7 @@ mo_mkpasswd(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *sou
|
|||
if(EmptyString(parv[1]))
|
||||
{
|
||||
sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), me.name, source_p->name, "MKPASSWD");
|
||||
return 0;
|
||||
return;
|
||||
}
|
||||
|
||||
if(parc < 3)
|
||||
|
@ -125,12 +124,11 @@ mo_mkpasswd(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *sou
|
|||
{
|
||||
sendto_one_notice(source_p,
|
||||
":MKPASSWD syntax error: MKPASSWD pass [SHA256|SHA512|MD5]");
|
||||
return 0;
|
||||
return;
|
||||
}
|
||||
|
||||
crypted = rb_crypt(parv[1], salt);
|
||||
sendto_one_notice(source_p, ":Hash [%s] for %s: %s", hashtype, parv[1], crypted ? crypted : "???");
|
||||
return 0;
|
||||
}
|
||||
|
||||
char *
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue