From c71318668571b3680fe10035a1a350ff46e459af Mon Sep 17 00:00:00 2001 From: Sam James Date: Thu, 20 Oct 2022 00:14:53 +0100 Subject: [PATCH] x509: fix -Wunused-but-set-variable The value of 'l' isn't ever actually used. Fixes this error with Clang 15: ``` crypto/x509/x_name.c:506:9: error: variable 'l' set but not used [-Werror,-Wunused-but-set-variable] int l, i; ^ 1 error generated. ``` Signed-off-by: Sam James Reviewed-by: Paul Dale Reviewed-by: Hugo Landau Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/19450) --- crypto/x509/x_name.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/crypto/x509/x_name.c b/crypto/x509/x_name.c index 98d03cf120..4568833f81 100644 --- a/crypto/x509/x_name.c +++ b/crypto/x509/x_name.c @@ -503,9 +503,7 @@ int X509_NAME_set(X509_NAME **xn, const X509_NAME *name) int X509_NAME_print(BIO *bp, const X509_NAME *name, int obase) { char *s, *c, *b; - int l, i; - - l = 80 - 2 - obase; + int i; b = X509_NAME_oneline(name, NULL, 0); if (b == NULL) @@ -531,12 +529,10 @@ int X509_NAME_print(BIO *bp, const X509_NAME *name, int obase) if (BIO_write(bp, ", ", 2) != 2) goto err; } - l--; } if (*s == '\0') break; s++; - l--; } OPENSSL_free(b); -- 2.34.1