summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLukas Fleischer <calcurse@cryptocrack.de>2011-01-13 23:21:40 +0000
committerLukas Fleischer <calcurse@cryptocrack.de>2011-03-03 12:21:25 +0100
commit2d938cdcdaa470d521f048d3b29e7a8a97612785 (patch)
tree3111968ae2b4e1eb83d83c27c29e355d240f01c5 /src
parent56b9cbcb844ff112f191e3589259e0d92292dda2 (diff)
downloadcalcurse-2d938cdcdaa470d521f048d3b29e7a8a97612785.tar.gz
calcurse-2d938cdcdaa470d521f048d3b29e7a8a97612785.zip
Avoid a segfault when resizing the help window.
Diffstat (limited to 'src')
-rw-r--r--src/help.c56
1 files changed, 29 insertions, 27 deletions
diff --git a/src/help.c b/src/help.c
index 81bcc99..e2b171c 100644
--- a/src/help.c
+++ b/src/help.c
@@ -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
@@ -109,32 +109,34 @@ help_write_pad (struct window *win, char *title, char *text, enum key action)
erase_window_part (win->p, rownum, colnum, BUFSIZ, win->w);
custom_apply_attr (win->p, ATTR_HIGHEST);
mvwprintw (win->p, rownum, colnum, "%s", title);
- switch (action)
- {
- case KEY_END_OF_WEEK:
- case KEY_START_OF_WEEK:
- case KEY_MOVE_UP:
- case KEY_MOVE_DOWN:
- case KEY_MOVE_RIGHT:
- case KEY_MOVE_LEFT:
- case KEY_GENERIC_HELP:
- case KEY_GENERIC_REDRAW:
- case KEY_GENERIC_ADD_APPT:
- case KEY_GENERIC_ADD_TODO:
- case KEY_GENERIC_NEXT_DAY:
- case KEY_GENERIC_PREV_DAY:
- case KEY_GENERIC_NEXT_WEEK:
- case KEY_GENERIC_PREV_WEEK:
- case KEY_GENERIC_GOTO_TODAY:
- case KEY_GENERIC_CREDITS:
- case KEY_GENERIC_CUT:
- case KEY_GENERIC_PASTE:
- break;
- default:
- bindings = keys_action_allkeys (action);
- colnum = win->w - strlen (bindings_title) - strlen (bindings);
- mvwprintw (win->p, rownum, colnum, bindings_title, bindings);
- }
+ if ((int) action != KEY_RESIZE) {
+ switch (action)
+ {
+ case KEY_END_OF_WEEK:
+ case KEY_START_OF_WEEK:
+ case KEY_MOVE_UP:
+ case KEY_MOVE_DOWN:
+ case KEY_MOVE_RIGHT:
+ case KEY_MOVE_LEFT:
+ case KEY_GENERIC_HELP:
+ case KEY_GENERIC_REDRAW:
+ case KEY_GENERIC_ADD_APPT:
+ case KEY_GENERIC_ADD_TODO:
+ case KEY_GENERIC_NEXT_DAY:
+ case KEY_GENERIC_PREV_DAY:
+ case KEY_GENERIC_NEXT_WEEK:
+ case KEY_GENERIC_PREV_WEEK:
+ case KEY_GENERIC_GOTO_TODAY:
+ case KEY_GENERIC_CREDITS:
+ case KEY_GENERIC_CUT:
+ case KEY_GENERIC_PASTE:
+ break;
+ default:
+ bindings = keys_action_allkeys (action);
+ colnum = win->w - strlen (bindings_title) - strlen (bindings);
+ mvwprintw (win->p, rownum, colnum, bindings_title, bindings);
+ }
+ }
colnum = 0;
rownum += get_help_lines (title);
custom_remove_attr (win->p, ATTR_HIGHEST);