[/trunk] Changeset 179 by mikael
authormikael
Wed, 04 May 2005 17:42:40 +0000
changeset 167 a6ac5498d254
parent 166 aa5b635520ef
child 168 6ad156673b19
[/trunk] Changeset 179 by mikael * Fix a crash when resized too small.
mcabber/src/TODO
mcabber/src/screen.c
--- 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);