From: Florian Westphal Date: Mon, 19 Jun 2023 20:43:01 +0000 (+0200) Subject: json: dccp: remove erroneous const qualifier X-Git-Tag: v1.0.8~28 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e5bf0485ff1ba0f2ff2fb3b03cfed1f98953dc1b;p=thirdparty%2Fnftables.git json: dccp: remove erroneous const qualifier 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 --- diff --git a/src/parser_json.c b/src/parser_json.c index 91b37b58..55c6b8c7 100644 --- a/src/parser_json.c +++ b/src/parser_json.c @@ -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;