tweaks: condense a fragment of code by making use of a helper function

(It copies a byte too many, which then gets overwritten in the next
statement, but this is not speed-critical code.)
master
Benno Schulenberg 2019-10-15 19:27:09 +02:00
parent 054559dc93
commit 1a8646393a
1 changed files with 1 additions and 2 deletions

View File

@ -150,8 +150,7 @@ void do_help(void)
/* Extract the title from the head of the help text. */
length = break_line(help_text, MAX_BUF_SIZE, TRUE);
title = charalloc(length * sizeof(char) + 1);
strncpy(title, help_text, length);
title = measured_copy(help_text, length + 1);
title[length] = '\0';
titlebar(title);