From 665963703bb08b5a97d4ba2e5c3efbeb06f0ddb5 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Thu, 25 May 2000 10:59:22 +0000 Subject: [PATCH] NAMES list crashed with long nicks .. hope it doesn't crash now somewhere else :) git-svn-id: http://svn.irssi.org/repos/irssi/trunk@228 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/fe-common/irc/fe-events-numeric.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fe-common/irc/fe-events-numeric.c b/src/fe-common/irc/fe-events-numeric.c index 5b692e58..2d24529c 100644 --- a/src/fe-common/irc/fe-events-numeric.c +++ b/src/fe-common/irc/fe-events-numeric.c @@ -80,7 +80,7 @@ static void display_sorted_nicks(CHANNEL_REC *channel, GSList *nicklist, gint it str = g_string_new(NULL); cols = max > 65 ? 1 : (65 / (max+3)); /* "[] " */ - lines = items <= cols ? 1 : items / cols+1; + lines = items <= cols ? 1 : (items-(cols-1)) / cols; last = NULL; linebuf = g_malloc(max+1); linebuf[max] = '\0'; for (line = 0, col = 0, skip = 1, tmp = nicklist; line < lines; last = rec, tmp = tmp->next)