* help.c (show): Fix segfault on unterminated help files.

From David Martin <dmartina@excite.com>
This commit is contained in:
Pavel Roskin 2002-08-31 14:20:14 +00:00
parent 581cd941f9
commit 74c4b19546
2 changed files with 4 additions and 1 deletions

View File

@ -1,5 +1,8 @@
2002-08-31 Pavel Roskin <proski@gnu.org>
* help.c (show): Fix segfault on unterminated help files.
From David Martin <dmartina@excite.com>
* key.c (get_event): Reduce scope of select_set. Don't check
mouse_enabled all the time, instead break out of the loop if it
becomes 0.

View File

@ -367,7 +367,7 @@ static void show (Dlg_head *h, char *paint_start)
if (selected_item < paint_start)
selected_item = NULL;
for (p = paint_start; *p != CHAR_NODE_END && line < help_lines; p++){
for (p = paint_start; *p && *p != CHAR_NODE_END && line < help_lines; p++) {
c = (unsigned char)*p;
switch (c){
case CHAR_LINK_START: