diff options
author | Sebastian Thorarensen <sebth@naju.se> | 2014-06-19 01:02:35 +0200 |
---|---|---|
committer | Sebastian Thorarensen <sebth@naju.se> | 2014-07-06 23:24:10 +0200 |
commit | 7bfe3a8fa1e9d59f94583390f2904d2f9204b9b5 (patch) | |
tree | ae05ef64777279e33abf2679b4e6250e134f633b /src | |
parent | 29a49c4688b55b2d62dce1638185707c1ec3d51d (diff) | |
download | irssi-7bfe3a8fa1e9d59f94583390f2904d2f9204b9b5.zip |
Introduce a MAX_USERHOST_LEN constant for IRC
Diffstat (limited to 'src')
-rw-r--r-- | src/irc/core/irc-servers.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/irc/core/irc-servers.c b/src/irc/core/irc-servers.c index 85bd207e..e1e79321 100644 --- a/src/irc/core/irc-servers.c +++ b/src/irc/core/irc-servers.c @@ -51,6 +51,12 @@ #define DEFAULT_CMDS_MAX_AT_ONCE 5 #define DEFAULT_MAX_QUERY_CHANS 1 /* more and more IRC networks are using stupid ircds.. */ +/* + * 63 is the maximum hostname length defined by the protocol. 10 is a common + * username limit on many networks. 1 is for the `@'. + */ +#define MAX_USERHOST_LEN (63 + 10 + 1) + void irc_servers_reconnect_init(void); void irc_servers_reconnect_deinit(void); @@ -169,11 +175,7 @@ static char **split_message(SERVER_REC *server, const char *target, const char *msg) { IRC_SERVER_REC *ircserver = IRC_SERVER(server); - /* - * 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; + int userhostlen = MAX_USERHOST_LEN; g_return_val_if_fail(ircserver != NULL, NULL); g_return_val_if_fail(target != NULL, NULL); @@ -453,8 +455,7 @@ void irc_server_send_action(IRC_SERVER_REC *server, const char *target, const ch char **irc_server_split_action(IRC_SERVER_REC *server, const char *target, const char *data) { - /* See split_message() on how the maximum length is calculated. */ - int userhostlen = 63 + 10 + 1; + int userhostlen = MAX_USERHOST_LEN; g_return_val_if_fail(server != NULL, NULL); g_return_val_if_fail(target != NULL, NULL); |