From 5a280a620d37ac223e0ece5fdf15b706c96e1fce Mon Sep 17 00:00:00 2001 From: Valentin Batz Date: Sat, 14 May 2005 18:01:07 +0000 Subject: [PATCH] Fixed a bug where the completion history can grow without bound, patch by Toby Peterson git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3755 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/fe-common/core/chat-completion.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fe-common/core/chat-completion.c b/src/fe-common/core/chat-completion.c index 84504aa0..dea73605 100644 --- a/src/fe-common/core/chat-completion.c +++ b/src/fe-common/core/chat-completion.c @@ -104,7 +104,7 @@ static void last_msg_add(GSList **list, const char *nick, int own, int max) rec = g_new(LAST_MSG_REC, 1); rec->nick = g_strdup(nick); - if ((int)g_slist_length(*list) == max) { + while ((int)g_slist_length(*list) >= max) { last_msg_destroy(list, g_slist_last(*list)->data); }