]> 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>
Mon, 8 Dec 2025 13:48:07 +0000 (14:48 +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>
(cherry picked from commit 70379d240dcf975d140160bb4c14cf1b3fe70bcc)

misc-utils/enosys.c

index 6afb2710797cd7a73a31cab8f777eae8d7a43627..5f780ae9800d95f758639b92a34f97cad68c23e6 100644 (file)
@@ -105,7 +105,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;