Browse files

Avoids segfault on NULL curswin for viewwin

When the screen is too small, newwin() fails and gives back a NULL
window. This avoids the crash.
  • Loading branch information...
1 parent 719173c commit fe4c786091ae4f138f1edc26a13b2b8d0b3a034d @davidben davidben committed Apr 30, 2010
Showing with 4 additions and 0 deletions.
  1. +4 −0 viewwin.c
View
4 viewwin.c
@@ -66,6 +66,10 @@ void owl_viewwin_set_onclose_hook(owl_viewwin *v, void (*onclose_hook) (owl_view
void owl_viewwin_redisplay(owl_viewwin *v)
{
owl_fmtext fm1, fm2;
+
+ /* avoid segfault when screen too small to create curswin */
+ if (v->curswin == NULL)
+ return;
werase(v->curswin);
wmove(v->curswin, 0, 0);

0 comments on commit fe4c786

Please sign in to comment.