]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lib/colors: correct documentation of colors_add_scheme()
authorThomas Weißschuh <thomas@t-8ch.de>
Wed, 27 Sep 2023 20:04:40 +0000 (22:04 +0200)
committerThomas Weißschuh <thomas@t-8ch.de>
Thu, 28 Sep 2023 06:13:17 +0000 (08:13 +0200)
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 <thomas@t-8ch.de>
lib/colors.c

index 2d4ba2fdba5243e46464f9e8e89251b0d275ebab..0928770a3bbe94d24c8f854c66cd10431601ea54 100644 (file)
@@ -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;