From 7556e5b3a4299efa97ba360d2e77829f4db18e90 Mon Sep 17 00:00:00 2001 From: William Lallemand Date: Sat, 20 Apr 2024 14:25:42 +0200 Subject: [PATCH] BUILD: ssl: use %zd for sizeof() in ssl_ckch.c 32bits build was broken because of wrong printf length modifier. src/ssl_ckch.c:4144:66: error: format specifies type 'long' but the argument has type 'unsigned int' [-Werror,-Wformat] 4143 | memprintf(err, "parsing [%s:%d] : cannot parse '%s' value '%s', too long, max len is %ld.\n", | ~~~ | %u 4144 | file, linenum, args[cur_arg], args[cur_arg + 1], sizeof(alias_name)); | ^~~~~~~~~~~~~~~~~~ src/ssl_ckch.c:4217:64: error: format specifies type 'long' but the argument has type 'unsigned int' [-Werror,-Wformat] 4216 | memprintf(err, "parsing [%s:%d] : cannot parse '%s' value '%s', too long, max len is %ld.\n", | ~~~ | %u 4217 | file, linenum, args[cur_arg], args[cur_arg + 1], sizeof(alias_name)); | ^~~~~~~~~~~~~~~~~~ 2 errors generated. make: *** [Makefile:1034: src/ssl_ckch.o] Error 1 make: *** Waiting for unfinished jobs.... Replace %ld by %zd. Should fix issue #2542. --- src/ssl_ckch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ssl_ckch.c b/src/ssl_ckch.c index 3e6917b44..1ac35adff 100644 --- a/src/ssl_ckch.c +++ b/src/ssl_ckch.c @@ -4140,7 +4140,7 @@ static int crtstore_parse_load(char **args, int section_type, struct proxy *curp rv = snprintf(alias_name, sizeof(alias_name), "@%s/%s", current_crtstore_name, args[cur_arg + 1]); if (rv >= sizeof(alias_name)) { - memprintf(err, "parsing [%s:%d] : cannot parse '%s' value '%s', too long, max len is %ld.\n", + memprintf(err, "parsing [%s:%d] : cannot parse '%s' value '%s', too long, max len is %zd.\n", file, linenum, args[cur_arg], args[cur_arg + 1], sizeof(alias_name)); err_code |= ERR_ALERT | ERR_FATAL; goto out; @@ -4213,7 +4213,7 @@ static int crtstore_parse_load(char **args, int section_type, struct proxy *curp /* add the crt-store name, avoid a double / if the crt starts by it */ rv = snprintf(alias_name, sizeof(alias_name), "@%s%s%s", current_crtstore_name, f.crt[0] != '/' ? "/" : "", f.crt); if (rv >= sizeof(alias_name)) { - memprintf(err, "parsing [%s:%d] : cannot parse '%s' value '%s', too long, max len is %ld.\n", + memprintf(err, "parsing [%s:%d] : cannot parse '%s' value '%s', too long, max len is %zd.\n", file, linenum, args[cur_arg], args[cur_arg + 1], sizeof(alias_name)); err_code |= ERR_ALERT | ERR_FATAL; goto out;