summaryrefslogtreecommitdiffstats
path: root/screen-display.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2007-11-24 12:33:56 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2007-11-24 12:33:56 +0000
commit4e21786eef987d90ca199d7bde3fc6109c9e2249 (patch)
treec9885254e78b4f2666d6e9291bc975c8d15ff6ca /screen-display.c
parenta01093603b3cf3683718836a8d10c01643881ac4 (diff)
Don't crash when deleting lines at the end, fixes irssi.
Diffstat (limited to 'screen-display.c')
-rw-r--r--screen-display.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/screen-display.c b/screen-display.c
index e1c1bc60..ff350a56 100644
--- a/screen-display.c
+++ b/screen-display.c
@@ -1,4 +1,4 @@
-/* $Id: screen-display.c,v 1.5 2007-11-21 22:20:44 nicm Exp $ */
+/* $Id: screen-display.c,v 1.6 2007-11-24 12:33:56 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -260,6 +260,8 @@ screen_display_insert_lines(struct screen *s, u_int py, u_int ny)
if (py + ny > screen_last_y(s))
ny = screen_last_y(s) - py;
+ if (ny == 0)
+ return;
/*
* Insert range of ny lines at py:
@@ -295,6 +297,8 @@ screen_display_insert_lines_region(struct screen *s, u_int py, u_int ny)
if (py + ny > s->rlower)
ny = s->rlower - py;
+ if (ny == 0)
+ return;
/*
* Insert range of ny lines at py:
@@ -330,6 +334,8 @@ screen_display_delete_lines(struct screen *s, u_int py, u_int ny)
if (py + ny > screen_last_y(s))
ny = screen_last_y(s) - py;
+ if (ny == 0)
+ return;
/*
* Delete range of ny lines at py:
@@ -365,6 +371,8 @@ screen_display_delete_lines_region(struct screen *s, u_int py, u_int ny)
if (py + ny > s->rlower)
ny = s->rlower - py;
+ if (ny == 0)
+ return;
/*
* Delete range of ny lines at py: