From: Sam James Date: Wed, 19 Oct 2022 23:14:53 +0000 (+0100) Subject: x509: fix -Wunused-but-set-variable X-Git-Tag: openssl-3.2.0-alpha1~1857 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c71318668571b3680fe10035a1a350ff46e459af;p=thirdparty%2Fopenssl.git 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) --- diff --git a/crypto/x509/x_name.c b/crypto/x509/x_name.c index 98d03cf1201..4568833f81b 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);