help: allocate enough space for the descriptions, so we don't crash

We should measure the length of each /translated/ shortcut description,
not of the original English one.

This fixes https://savannah.gnu.org/bugs/?50899.
master
Benno Schulenberg 2017-04-30 12:49:30 +02:00
parent a8a60b29e6
commit 395c8e9e25
1 changed files with 1 additions and 1 deletions

View File

@ -470,7 +470,7 @@ void help_init(void)
* plus one or two \n's. */
for (f = allfuncs; f != NULL; f = f->next)
if (f->menus & currmenu)
allocsize += (16 * MAXCHARLEN) + strlen(f->help) + 2;
allocsize += (16 * MAXCHARLEN) + strlen(_(f->help)) + 2;
#ifndef NANO_TINY
/* If we're on the main list, we also count the toggle help text.