1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-07 10:13:12 +02:00

irc: fix some malloc sizes

This commit is contained in:
Sebastien Helleu
2014-02-28 11:39:24 +01:00
parent 7213fe5826
commit 6ea8c2d83c
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -431,8 +431,8 @@ irc_completion_channel_topic_cb (void *data, const char *completion_item,
* instead of
* /topic #test is a test channel
*/
length = strlen (ptr_channel->name) + strlen (ptr_channel->topic) + 16;
topic = malloc (length + 1);
length = strlen (ptr_channel->name) + strlen (ptr_channel->topic) + 16 + 1;
topic = malloc (length);
if (topic)
{
snprintf (topic, length, "%s %s",