summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandmarti1424 <andmarti@gmail.com>2017-07-29 09:27:38 -0300
committerandmarti1424 <andmarti@gmail.com>2017-07-29 09:27:38 -0300
commitd76edd90b8635245478ab85cbf2fc14a3eec6e7c (patch)
treedeac8905fb7cfa51135d268f9dc04983e630a516
parentd8e73b14178f6fbe8b575df71140088dca0760b9 (diff)
Work on issue #188
-rw-r--r--src/help.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/help.c b/src/help.c
index 9740793..a115cbd 100644
--- a/src/help.c
+++ b/src/help.c
@@ -281,8 +281,12 @@ void find_word(char * word, char order) {
int show_lines() {
int lineno, i, k, key = 0, bold = 0 ;
- for (lineno = 0; long_help[lineno + delta] && lineno < LINES - RESROW; lineno++) {
- if (strlen(word_looked)) look_result = str_in_str(long_help[lineno + delta], word_looked);
+ for (lineno = 0; lineno + delta <= max && long_help[lineno + delta] && lineno < LINES - RESROW; lineno++) {
+ if (strlen(word_looked))
+ look_result =
+ str_in_str(
+ long_help[lineno + delta],
+ word_looked);
wmove(main_win, lineno, 0);
wclrtoeol(main_win);