From 5fd89d255b7f4f66ad2b5040919532131750d952 Mon Sep 17 00:00:00 2001 From: Tiago Vignatti Date: Mon, 10 Jan 2011 19:30:04 +0200 Subject: [PATCH] terminal: fix crashing when terminal size is < 0 Just skip drawing when width or height is less than zero. Signed-off-by: Tiago Vignatti --- clients/terminal.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/clients/terminal.c b/clients/terminal.c index 4bfb06b..1c7cbbf 100644 --- a/clients/terminal.c +++ b/clients/terminal.c @@ -838,6 +838,10 @@ terminal_draw(struct terminal *terminal) (int32_t) terminal->extents.max_x_advance; height = (rectangle.height - 2 * terminal->margin) / (int32_t) terminal->extents.height; + + if (width < 0 || height < 0) + return; + terminal_resize(terminal, width, height); window_draw(terminal->window); -- 2.7.4