Avoid a segfault when resizing the help window.

This commit is contained in:
Lukas Fleischer 2011-01-13 23:21:40 +00:00
parent 56b9cbcb84
commit 2d938cdcda
2 changed files with 34 additions and 27 deletions

View File

@ -1,3 +1,8 @@
2011-01-14 Lukas Fleischer <calcurse@cryptocrack.de>
* src/help.c: Avoid a segfault when resizing the help window
(resizing still needs to be fixed properly).
2011-01-11 Lukas Fleischer <calcurse@cryptocrack.de> 2011-01-11 Lukas Fleischer <calcurse@cryptocrack.de>
* AUTHORS * AUTHORS

View File

@ -1,4 +1,4 @@
/* $calcurse: help.c,v 1.45 2011/01/11 22:31:40 fleischer Exp $ */ /* $calcurse: help.c,v 1.46 2011/01/13 23:21:40 fleischer Exp $ */
/* /*
* Calcurse - text-based organizer * Calcurse - text-based organizer
@ -109,6 +109,7 @@ help_write_pad (struct window *win, char *title, char *text, enum key action)
erase_window_part (win->p, rownum, colnum, BUFSIZ, win->w); erase_window_part (win->p, rownum, colnum, BUFSIZ, win->w);
custom_apply_attr (win->p, ATTR_HIGHEST); custom_apply_attr (win->p, ATTR_HIGHEST);
mvwprintw (win->p, rownum, colnum, "%s", title); mvwprintw (win->p, rownum, colnum, "%s", title);
if ((int) action != KEY_RESIZE) {
switch (action) switch (action)
{ {
case KEY_END_OF_WEEK: case KEY_END_OF_WEEK:
@ -135,6 +136,7 @@ help_write_pad (struct window *win, char *title, char *text, enum key action)
colnum = win->w - strlen (bindings_title) - strlen (bindings); colnum = win->w - strlen (bindings_title) - strlen (bindings);
mvwprintw (win->p, rownum, colnum, bindings_title, bindings); mvwprintw (win->p, rownum, colnum, bindings_title, bindings);
} }
}
colnum = 0; colnum = 0;
rownum += get_help_lines (title); rownum += get_help_lines (title);
custom_remove_attr (win->p, ATTR_HIGHEST); custom_remove_attr (win->p, ATTR_HIGHEST);