1
0
mirror of https://github.com/irssi/irssi.git synced 2024-07-21 03:14:16 -04:00

use better number parsing

This commit is contained in:
ailin-nemui 2019-08-14 21:17:53 +02:00
parent da9adec47f
commit 200020da93

View File

@ -484,8 +484,10 @@ static void sig_server_quit(IRC_SERVER_REC *server, const char *msg)
static void cap_maxline(IRC_SERVER_REC *server)
{
int maxline = atoi(g_hash_table_lookup(server->cap_supported, CAP_MAXLINE));
if (maxline >= MAX_IRC_MESSAGE_LEN + 2 /* 2 bytes for CR+LF */) {
unsigned int maxline = 0;
if (parse_uint(g_hash_table_lookup(server->cap_supported, CAP_MAXLINE),
NULL, 10, &maxline) &&
maxline >= MAX_IRC_MESSAGE_LEN + 2 /* 2 bytes for CR+LF */) {
server->max_message_len = maxline - 2;
}
}