summaryrefslogtreecommitdiffstats
path: root/crypto/x509/t_x509.c
diff options
context:
space:
mode:
authorDavid von Oheimb <David.von.Oheimb@siemens.com>2018-01-29 16:54:40 +0100
committerMatt Caswell <matt@openssl.org>2019-03-18 17:17:55 +0000
commita4c467c96aeae3d52e2f16b8b829749ed6c55fe7 (patch)
tree1cd7cb1f417d3b1fc086de5ddcdf91c9ead38fc5 /crypto/x509/t_x509.c
parentc13d2ab439a9dcbbf22ef85a00603142b0a37779 (diff)
remove needless empty lines when printing certificates
Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6226)
Diffstat (limited to 'crypto/x509/t_x509.c')
-rw-r--r--crypto/x509/t_x509.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/crypto/x509/t_x509.c b/crypto/x509/t_x509.c
index 29e20939ec..fb367baa1e 100644
--- a/crypto/x509/t_x509.c
+++ b/crypto/x509/t_x509.c
@@ -284,7 +284,7 @@ int X509_signature_dump(BIO *bp, const ASN1_STRING *sig, int indent)
s = sig->data;
for (i = 0; i < n; i++) {
if ((i % 18) == 0) {
- if (BIO_write(bp, "\n", 1) <= 0)
+ if (i > 0 && BIO_write(bp, "\n", 1) <= 0)
return 0;
if (BIO_indent(bp, indent, indent) <= 0)
return 0;
@@ -317,10 +317,10 @@ int X509_signature_print(BIO *bp, const X509_ALGOR *sigalg,
return ameth->sig_print(bp, sigalg, sig, 9, 0);
}
}
+ if (BIO_write(bp, "\n", 1) != 1)
+ return 0;
if (sig)
return X509_signature_dump(bp, sig, 9);
- else if (BIO_puts(bp, "\n") <= 0)
- return 0;
return 1;
}