From 83336e3436e36d501fe42e4da3dffa5abcbb398e Mon Sep 17 00:00:00 2001 From: Eric Blankenhorn Date: Mon, 13 Oct 2025 12:15:39 -0500 Subject: [PATCH] Fix from testing --- src/pk.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pk.c b/src/pk.c index b0d866aa8..4da27c439 100644 --- a/src/pk.c +++ b/src/pk.c @@ -737,12 +737,13 @@ static int wolfssl_print_indent(WOLFSSL_BIO* bio, char* line, int lineLen, int ret = 1; if (indent > 0) { + int len_wanted; /* Cap indent to buffer size to avoid format truncation warning */ if (indent >= lineLen) { indent = lineLen - 1; } /* Print indent spaces. */ - int len_wanted = XSNPRINTF(line, (size_t)lineLen, "%*s", indent, " "); + len_wanted = XSNPRINTF(line, (size_t)lineLen, "%*s", indent, " "); if ((len_wanted < 0) || (len_wanted >= lineLen)) { WOLFSSL_ERROR_MSG("Buffer overflow formatting indentation"); ret = 0;