Ensure there is enough space for the mask

As pointed by Alex while strl{cat,cpy} take the full length
we need to leave space to ensure a proper mask is always created
so revert the removal of - N from my last change.
This commit is contained in:
Federico G. Schwindt 2013-04-20 10:53:16 +01:00
parent b4d0a40383
commit 51e5ba94b3
1 changed files with 3 additions and 3 deletions

View File

@ -279,16 +279,16 @@ Lists_MakeMask(const char *Pattern, char *mask, size_t len)
if (!at && !excl) {
/* Neither "!" nor "@" found: use string as nickname */
strlcpy(mask, Pattern, len);
strlcpy(mask, Pattern, len - 5);
strlcat(mask, "!*@*", len);
} else if (!at && excl) {
/* Domain part is missing */
strlcpy(mask, Pattern, len);
strlcpy(mask, Pattern, len - 3);
strlcat(mask, "@*", len);
} else if (at && !excl) {
/* User name is missing */
*at = '\0'; at++;
strlcpy(mask, Pattern, len);
strlcpy(mask, Pattern, len - 5);
strlcat(mask, "!*@", len);
strlcat(mask, at, len);
} else {