summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authortb <>2023-07-10 02:33:33 +0000
committertb <>2023-07-10 02:33:33 +0000
commite4901ad74ba3829939db6c8afb51516f25edd2cc (patch)
tree2be200243474ef8d75528e7d967944df5b865d19 /src/lib
parentde8024f69fad36b699d8447ecfffd3a0f6ed44f1 (diff)
downloadopenbsd-e4901ad74ba3829939db6c8afb51516f25edd2cc.tar.gz
openbsd-e4901ad74ba3829939db6c8afb51516f25edd2cc.tar.bz2
openbsd-e4901ad74ba3829939db6c8afb51516f25edd2cc.zip
BIO_indent: use %*s rather than puts in a loop
ok beck jsing millert
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libcrypto/bio/bio_lib.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/lib/libcrypto/bio/bio_lib.c b/src/lib/libcrypto/bio/bio_lib.c
index 3dd5e17ed3..c0a74ee29b 100644
--- a/src/lib/libcrypto/bio/bio_lib.c
+++ b/src/lib/libcrypto/bio/bio_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bio_lib.c,v 1.46 2023/07/07 19:37:53 beck Exp $ */ 1/* $OpenBSD: bio_lib.c,v 1.47 2023/07/10 02:33:33 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -548,11 +548,10 @@ BIO_indent(BIO *b, int indent, int max)
548{ 548{
549 if (indent > max) 549 if (indent > max)
550 indent = max; 550 indent = max;
551 if (indent < 0) 551 if (indent <= 0)
552 indent = 0; 552 return 1;
553 while (indent--) 553 if (BIO_printf(b, "%*s", indent, "") <= 0)
554 if (BIO_puts(b, " ") != 1) 554 return 0;
555 return 0;
556 return 1; 555 return 1;
557} 556}
558LCRYPTO_ALIAS(BIO_indent); 557LCRYPTO_ALIAS(BIO_indent);