From 99d30f02f789ba897723fbdf46d599689c9aa90c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Thomas=20Wei=C3=9Fschuh?= Date: Wed, 27 Sep 2023 22:04:40 +0200 Subject: [PATCH] lib/colors: correct documentation of colors_add_scheme() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The function does not take ownership of its arguments and it does not require those arguments to be heap-allocated. In fact there is only one caller and it passed stack-allocated values. Signed-off-by: Thomas Weißschuh --- lib/colors.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/colors.c b/lib/colors.c index 2d4ba2fdba..0928770a3b 100644 --- a/lib/colors.c +++ b/lib/colors.c @@ -357,12 +357,10 @@ static char *colors_get_homedir(char *buf, size_t bufsz) /* * Adds one color sequence to array with color scheme. - * When returning success (0) this function takes ownership of - * @seq and @name, which have to be allocated strings. */ static int colors_add_scheme(struct ul_color_ctl *cc, - char *name, - char *seq0) + const char *name, + const char *seq0) { struct ul_color_scheme *cs = NULL; char *seq = NULL; -- 2.47.3