mirror of
https://github.com/irssi/irssi.git
synced 2025-02-02 15:08:01 -05:00
Fix the userhostlen' fallback in
split_message'
ferret, the author of `splitlong-safe.pl' pointed out that `userhostlen' should not only contain the maximum length of the hostname, but also the maximum length of the username. Now 10 is used as the maximum username length as a fallback. (`splitlong-safe.pl' uses the same limit.) The username limit isn't defined in the standard, but 10 is common on many networks. The odds that something goes wrong here is low, as 1) the fallback limit is only used when the user has not yet joined a channel 2) the maximum hostname length (63) gives some error margin as the hostname usually is shorter
This commit is contained in:
parent
281c6d437d
commit
90f3dd612e
@ -169,7 +169,11 @@ static char **split_message(SERVER_REC *server, const char *target,
|
||||
const char *msg)
|
||||
{
|
||||
IRC_SERVER_REC *ircserver = IRC_SERVER(server);
|
||||
int userhostlen = 63; /* Maximum length defined by protocol. */
|
||||
/*
|
||||
* 63 is the maxmium hostname length defined by the protocol. 10 is
|
||||
* a common username limit on many networks. 1 is for the `@'.
|
||||
*/
|
||||
int userhostlen = 63 + 10 + 1;
|
||||
|
||||
g_return_val_if_fail(ircserver != NULL, NULL);
|
||||
g_return_val_if_fail(target != NULL, NULL);
|
||||
|
Loading…
Reference in New Issue
Block a user