diff --git a/ChangeLog b/ChangeLog index 79c51c55..79ceeab0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -34,6 +34,9 @@ General modify_control_key. Removed #ifdef _POSIX_VDISABLE check around Control-S,Q,Z handlers because we need it now for the Alt-Alt-x code. + help_init() + - Fix off by one error that was making ^G help in normal mode and + ^_ in pico mode not be displayed in the help. - nano.1, nano.1.html: - Updated man page for -b, -e, -f and expanded explanation for -p. - utils.c: diff --git a/nano.c b/nano.c index 890293bc..8033fb65 100644 --- a/nano.c +++ b/nano.c @@ -1912,11 +1912,11 @@ void help_init(void) { int i, sofar = 0; long allocsize = 1; /* How much space we're gonna need for the help text */ - char buf[BUFSIZ]; + char buf[BUFSIZ] = ""; /* Compute the space needed for the shortcut lists - we add 15 to have room for the shortcut abbrev and its possible alternate keys */ - for (i = 0; i < MAIN_LIST_LEN; i++) + for (i = 0; i <= MAIN_LIST_LEN - 1; i++) if (main_list[i].help != NULL) allocsize += strlen(main_list[i].help) + 15; @@ -1937,7 +1937,7 @@ void help_init(void) strcpy(help_text, help_text_init); /* Now add our shortcut info */ - for (i = 0; i < MAIN_LIST_LEN - 1; i++) { + for (i = 0; i <= MAIN_LIST_LEN - 1; i++) { sofar = snprintf(buf, BUFSIZ, "^%c ", main_list[i].val + 64); if (main_list[i].misc1 > KEY_F0 && main_list[i].misc1 <= KEY_F(64))