From 960c8e6174374ee113b290c304365bf02ed346d6 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Tue, 9 Mar 2021 11:26:47 +0100 Subject: Drop pointless local variable in snprintf callbacks A common idiom among snprintf callbacks was to copy the unsigned parameter 'size' (or 'len') into a signed variable for further use. Though since snprintf() itself casts it to unsigned and SNPRINTF_BUFFER_SIZE() does not allow it to become negative, this is not needed. Drop the local variable and rename the parameter accordingly. Signed-off-by: Phil Sutter --- src/obj/synproxy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/obj/synproxy.c') diff --git a/src/obj/synproxy.c b/src/obj/synproxy.c index e3a991b..d689fee 100644 --- a/src/obj/synproxy.c +++ b/src/obj/synproxy.c @@ -117,12 +117,12 @@ static int nftnl_obj_synproxy_parse(struct nftnl_obj *e, struct nlattr *attr) return 0; } -static int nftnl_obj_synproxy_snprintf(char *buf, size_t size, +static int nftnl_obj_synproxy_snprintf(char *buf, size_t len, uint32_t flags, const struct nftnl_obj *e) { struct nftnl_obj_synproxy *synproxy = nftnl_obj_data(e); - int ret, offset = 0, len = size; + int ret, offset = 0; if (e->flags & (1 << NFTNL_OBJ_SYNPROXY_MSS) && e->flags & (1 << NFTNL_OBJ_SYNPROXY_WSCALE)) { -- cgit v1.2.3