]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lsfd: fix const qualifier warning in new_counter_spec
authorKarel Zak <kzak@redhat.com>
Thu, 27 Nov 2025 15:35:56 +0000 (16:35 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 8 Dec 2025 13:48:07 +0000 (14:48 +0100)
Fix const qualifier discarded warning in new_counter_spec().
This warning is reported by gcc 15 which defaults to the C23 standard.

The function modifies the input string by inserting a null terminator
to split it into name and expression parts, so the parameter should
be char * rather than const char *.

Signed-off-by: Karel Zak <kzak@redhat.com>
(cherry picked from commit 014d2779afb4118d7117442eeed562e2c7b7594f)

lsfd-cmd/lsfd.c

index 9aae240fcbd7821664711dcb1079177cd3365a41..2e83acf914b454dddc3ebbdca896477226d6038a 100644 (file)
@@ -2278,7 +2278,7 @@ static struct libscols_filter *new_filter(const char *expr, bool debug, struct l
        return f;
 }
 
-static struct counter_spec *new_counter_spec(const char *spec_str)
+static struct counter_spec *new_counter_spec(char *spec_str)
 {
        char *sep;
        struct counter_spec *spec;