From 1a8646393a3474cc4d50fe94996369097e7a1dfd Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Tue, 15 Oct 2019 19:27:09 +0200 Subject: [PATCH] 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.) --- src/help.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/help.c b/src/help.c index 6a717798..e1fa3ba1 100644 --- 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);