[PATCH v2 13/19] keytoc: Let openssl_error() take a format string
Sascha Hauer
s.hauer at pengutronix.de
Wed Jul 31 22:57:31 PDT 2024
Make openssl_error() a bit more versatile.
Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
scripts/keytoc.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/scripts/keytoc.c b/scripts/keytoc.c
index 0883ca64f7..aa36ba02e1 100644
--- a/scripts/keytoc.c
+++ b/scripts/keytoc.c
@@ -25,11 +25,14 @@
static int dts, standalone;
-static int openssl_error(const char *msg)
+static int openssl_error(const char *fmt, ...)
{
+ va_list va;
unsigned long sslErr = ERR_get_error();
- fprintf(stderr, "%s", msg);
+ va_start(va, fmt);
+ vfprintf(stderr, fmt, va);
+ va_end(va);
fprintf(stderr, ": %s\n",
ERR_error_string(sslErr, 0));
--
2.39.2
More information about the barebox
mailing list