From 1b101d0e13ac9049eb40f2551caad955c7888e06 Mon Sep 17 00:00:00 2001 From: tb Date: Thu, 11 Aug 2022 10:36:32 +0000 Subject: [PATCH] Remove unused variable X509_NAME_print() is documented to print things at a given indentation level. Unfortunately, this never worked since someone got some logic wrong. Part of the wrong logic was removed in a dead code removal in OpenSSL commit 92ada7cc, but the variable l was left behind, which leads to compiler warnings on some platforms. End its sad life pointlessly and incorrectly measuring column width and remove it. ok jsing --- lib/libcrypto/asn1/t_x509.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/libcrypto/asn1/t_x509.c b/lib/libcrypto/asn1/t_x509.c index b2fd80b559b..5f520f5cb89 100644 --- a/lib/libcrypto/asn1/t_x509.c +++ b/lib/libcrypto/asn1/t_x509.c @@ -1,4 +1,4 @@ -/* $OpenBSD: t_x509.c,v 1.39 2022/08/10 16:51:26 tb Exp $ */ +/* $OpenBSD: t_x509.c,v 1.40 2022/08/11 10:36:32 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -470,9 +470,8 @@ int X509_NAME_print(BIO *bp, const X509_NAME *name, int obase) { char *s, *c, *b; - int ret = 0, l, i; - - l = 80 - 2 - obase; + int i; + int ret = 0; b = X509_NAME_oneline(name, NULL, 0); if (b == NULL) @@ -497,12 +496,10 @@ 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--; } ret = 1; -- 2.20.1