]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
json: dccp: remove erroneous const qualifier
authorFlorian Westphal <fw@strlen.de>
Mon, 19 Jun 2023 20:43:01 +0000 (22:43 +0200)
committerFlorian Westphal <fw@strlen.de>
Tue, 20 Jun 2023 19:44:49 +0000 (21:44 +0200)
This causes a clang warning:

parser_json.c:767:6: warning: variable 'opt_type' is uninitialized when used here [-Wuninitialized]
if (opt_type < DCCPOPT_TYPE_MIN || opt_type > DCCPOPT_TYPE_MAX) {
            ^~~~~~~~
... because it deduces the object is readonly.

Signed-off-by: Florian Westphal <fw@strlen.de>
src/parser_json.c

index 91b37b58f2bfeb685f3924299621575bb4293ef0..55c6b8c7df9055fd424797c372b3fa2bb9dddc7a 100644 (file)
@@ -807,7 +807,7 @@ static struct expr *json_parse_sctp_chunk_expr(struct json_ctx *ctx,
 static struct expr *json_parse_dccp_option_expr(struct json_ctx *ctx,
                                                const char *type, json_t *root)
 {
-       const int opt_type;
+       int opt_type;
 
        if (json_unpack_err(ctx, root, "{s:i}", "type", &opt_type))
                return NULL;