From: Zbigniew Jędrzejewski-Szmek Date: Sun, 8 May 2022 10:39:15 +0000 (+0200) Subject: libsystemd-network: constify casts X-Git-Tag: v251-rc3~38^2~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c9c3b81f12100b84b493575f3f93235108185cec;p=thirdparty%2Fsystemd.git libsystemd-network: constify casts It is better to not drop the const-ness from the argument. --- 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;