commit 1a8646393a3474cc4d50fe94996369097e7a1dfd
parent 054559dc9367b893f50599c7e3c8e624be9a53e4
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Tue, 15 Oct 2019 19:27:09 +0200
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.)
Diffstat:
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/help.c b/src/help.c
@@ -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);