0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-26 08:42:34 +01:00

m_pass.c fixed

This commit is contained in:
Valery Yatsko 2008-04-02 19:45:22 +04:00
parent 54ac8b60a1
commit 97b41ffab9
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)