m_pass.c fixed

This commit is contained in:
Valery Yatsko 2008-04-02 19:45:22 +04:00
parent 21c9d815d7
commit de2fb6e2ae
2 changed files with 1 additions and 7 deletions

View File

@ -99,12 +99,6 @@ size_t strlcpy(char *dst, const char *src, size_t siz);
size_t strlcat(char *dst, const char *src, size_t siz);
#endif
#ifdef HAVE_STRNDUP
#define DupNString(x, y, len) do { x = strndup(y, len); if(x == NULL) outofmemory(); } while (0)
#else
#define DupNString(x, y, len) do { x = malloc(len+1); if(x == NULL) outofmemory(); strlcpy(x, y, len+1); } while(0)
#endif
/*
* clean_string - cleanup control and high ascii characters
* -Dianora

View File

@ -67,7 +67,7 @@ mr_pass(struct Client *client_p, struct Client *source_p, int parc, const char *
rb_free(client_p->localClient->passwd);
}
DupNString(client_p->localClient->passwd, parv[1], PASSWDLEN);
client_p->localClient->passwd = rb_strndup(parv[1], PASSWDLEN);
/* These are for servers only */
if(parc > 2 && client_p->user == NULL)