]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
enosys: fix const qualifier warning in parse_block
authorKarel Zak <kzak@redhat.com>
Thu, 27 Nov 2025 15:47:46 +0000 (16:47 +0100)
committerKarel Zak <kzak@redhat.com>
Thu, 27 Nov 2025 15:47:46 +0000 (16:47 +0100)
Fix const qualifier discarded warning in parse_block().
This warning is reported by gcc 15 which defaults to the C23 standard.

The strchr() function returns a pointer into a const string, so the
receiving variable must be declared as const char *.

Signed-off-by: Karel Zak <kzak@redhat.com>
misc-utils/enosys.c

index 68e426c9ddc1cbc5dd8919170cf5d6000d6d5205..f1438b8e83ee11d84bc147bdb532c23d503d290c 100644 (file)
@@ -108,7 +108,7 @@ static struct blocked_number *parse_block(const char *s, int ret, const struct s
        struct blocked_number *blocked;
        const char *name, *error_name;
        long blocked_number;
-       char *colon;
+       const char *colon;
        bool found;
        size_t i;