From c9c3b81f12100b84b493575f3f93235108185cec Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sun, 8 May 2022 12:39:15 +0200 Subject: [PATCH] libsystemd-network: constify casts It is better to not drop the const-ness from the argument. --- src/libsystemd-network/dhcp-option.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libsystemd-network/dhcp-option.c b/src/libsystemd-network/dhcp-option.c index efb676e60b3..7f49da7c2d7 100644 --- a/src/libsystemd-network/dhcp-option.c +++ b/src/libsystemd-network/dhcp-option.c @@ -62,7 +62,7 @@ static int option_append(uint8_t options[], size_t size, size_t *offset, if (strv_isempty((char **) optval)) return -EINVAL; - STRV_FOREACH(s, (char **) optval) { + STRV_FOREACH(s, (const char* const*) optval) { size_t len = strlen(*s); if (len > 255 || len == 0) @@ -78,7 +78,7 @@ static int option_append(uint8_t options[], size_t size, size_t *offset, options[*offset + 1] = total; *offset += 2; - STRV_FOREACH(s, (char **) optval) { + STRV_FOREACH(s, (const char* const*) optval) { size_t len = strlen(*s); options[*offset] = len; -- 2.47.3