changeset 167:a6ac5498d254

[/trunk] Changeset 179 by mikael * Fix a crash when resized too small.
author mikael
date Wed, 04 May 2005 17:42:40 +0000
parents aa5b635520ef
children 6ad156673b19
files mcabber/src/TODO mcabber/src/screen.c
diffstat 2 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mcabber/src/TODO	Wed May 04 17:11:59 2005 +0000
+++ b/mcabber/src/TODO	Wed May 04 17:42:40 2005 +0000
@@ -1,7 +1,6 @@
 
 BUGS:
 
-* Check if it crashes when resized too small...  Can we have a minimum size?
 * Colors are misnamed
 
 
--- a/mcabber/src/screen.c	Wed May 04 17:11:59 2005 +0000
+++ b/mcabber/src/screen.c	Wed May 04 17:42:40 2005 +0000
@@ -421,6 +421,8 @@
   ParseColors();
 
   getmaxyx(stdscr, maxY, maxX);
+  if (maxY < LOG_WIN_HEIGHT+2)
+    maxY = LOG_WIN_HEIGHT+2;
   inputLine[0] = 0;
   ptr_inputline = inputLine;
 
@@ -524,6 +526,8 @@
 
   // First, update the global variables
   getmaxyx(stdscr, maxY, maxX);
+  if (maxY < LOG_WIN_HEIGHT+2)
+    maxY = LOG_WIN_HEIGHT+2;
   // Make sure the cursor stays inside the window
   check_offset(0);