]> 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>
Thu, 27 Nov 2025 15:35:56 +0000 (16:35 +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>
lsfd-cmd/lsfd.c

index b7d996f6e817e415780123bf3a1e8743e2ecdd6a..26d0bd54a611a5eb7b58e56b3fa171871b0bfa97 100644 (file)
@@ -2320,7 +2320,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;