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 <sam@gentoo.org>

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19450)
This commit is contained in:
Sam James 2022-10-20 00:14:53 +01:00 committed by Tomas Mraz
parent f9e8e2c0ab
commit c713186685

View File

@ -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);