diff -u nano/nano.c nano-help/nano.c --- nano/nano.c Wed Feb 5 09:24:04 2003 +++ nano-help/nano.c Wed Feb 5 09:38:19 2003 @@ -391,7 +391,7 @@ * COLS - 24 characters, plus '\n'.*/ if (currshortcut == main_list) for (t = toggles; t != NULL; t = t->next) - allocsize += COLS - 17; + allocsize += 7 + (COLS > 24 ? COLS - 24 : 0); #endif /* !NANO_SMALL */ /* help_text has been freed and set to NULL unless the user resized @@ -448,16 +448,25 @@ *(ptr++) = '\t'; assert(s->help != NULL); - ptr += sprintf(ptr, "%.*s\n", COLS - 24, s->help); + ptr += sprintf(ptr, "%.*s\n", COLS > 24 ? COLS - 24 : 0, s->help); } #ifndef NANO_SMALL /* And the toggles... */ if (currshortcut == main_list) for (t = toggles; t != NULL; t = t->next) { + int foo = COLS > 24 ? COLS - 24 : 0; + int num_prnt; + ptr += sprintf(ptr, "M-%c\t\t\t", t->val - 32); assert(t->desc != NULL); - ptr += sprintf(ptr, _("%.*s enable/disable\n"), COLS - 24, t->desc); + if (COLS > 24) { + int num_prnt = sprintf(ptr, "%.*s", COLS - 24, t->desc); + + ptr += num_prnt; + ptr += sprintf(ptr, _(" enable/disable\n"), + COLS - 24 - num_prnt); + } } #endif /* !NANO_SMALL */