summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEmanuele Giaquinta <exg@irssi.org>2012-06-24 14:33:54 +0000
committerexg <exg@dbcabf3a-b0e7-0310-adc4-f8d773084564>2012-06-24 14:33:54 +0000
commit02aa2682dcd6de0defcdc88756dd92e25ae268a4 (patch)
tree826dcd0914a63f5d36792caf031ea24f335f3d5c /src
parent7ae491922905fbc800c6c389517a5fbcce6f5734 (diff)
downloadirssi-02aa2682dcd6de0defcdc88756dd92e25ae268a4.zip
Fix crash in mainwindows_resize_smaller when the 'mainwindows' list is empty.
The crash can happen if the terminal height decreases before the first window is created. Based on a patch by Jaroslav Škarvada (red hat bug #796457). git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@5217 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src')
-rw-r--r--src/fe-text/mainwindows.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/fe-text/mainwindows.c b/src/fe-text/mainwindows.c
index 6cb567cc..5f58c25f 100644
--- a/src/fe-text/mainwindows.c
+++ b/src/fe-text/mainwindows.c
@@ -355,6 +355,9 @@ static void mainwindows_resize_smaller(int xdiff, int ydiff)
int space;
sorted = mainwindows_get_sorted(TRUE);
+ if (sorted == NULL)
+ return;
+
for (;;) {
space = 0;
for (tmp = mainwindows; tmp != NULL; tmp = tmp->next) {