diff options
author | michael <michael@82007160-df01-0410-b94d-b575c5fd34c7> | 2012-11-07 21:02:43 +0000 |
---|---|---|
committer | michael <michael@82007160-df01-0410-b94d-b575c5fd34c7> | 2012-11-07 21:02:43 +0000 |
commit | 31f925f50413118a16a16632d7d86cfed1783602 (patch) | |
tree | d7811f77cdd331aeef6c95e0da25db2477c00a0b /modules/m_pass.c | |
parent | a08e07b05d737a20f404841ac925fa0ff75eca54 (diff) |
- First pass of conf parser stabilization/cleanup
git-svn-id: svn://svn.ircd-hybrid.org/svnroot/ircd-hybrid/trunk@1646 82007160-df01-0410-b94d-b575c5fd34c7
Diffstat (limited to 'modules/m_pass.c')
-rw-r--r-- | modules/m_pass.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/modules/m_pass.c b/modules/m_pass.c index be78c7c..230dcd5 100644 --- a/modules/m_pass.c +++ b/modules/m_pass.c @@ -32,6 +32,7 @@ #include "modules.h" #include "s_serv.h" #include "s_user.h" +#include "s_misc.h" /* @@ -47,11 +48,9 @@ static void mr_pass(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { - char *password = parv[1]; - assert(client_p == source_p); - if (EmptyString(password)) + if (EmptyString(parv[1])) { sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), me.name, source_p->name[0] ? source_p->name : "*", "PASS"); @@ -59,9 +58,7 @@ mr_pass(struct Client *client_p, struct Client *source_p, } MyFree(source_p->localClient->passwd); - if (strlen(password) > PASSWDLEN) - password[PASSWDLEN] = '\0'; - DupString(source_p->localClient->passwd, password); + source_p->localClient->passwd = xstrndup(parv[1], IRCD_MIN(strlen(parv[1]), PASSWDLEN)); if (parc > 2) { |