[PATCH v2 13/19] keytoc: Let openssl_error() take a format string
Ahmad Fatoum
a.fatoum at pengutronix.de
Mon Aug 5 03:22:00 PDT 2024
On 01.08.24 07:57, Sascha Hauer wrote:
> Make openssl_error() a bit more versatile.
>
> Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
Reviewed-by: Ahmad Fatoum <a.fatoum 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));
>
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
More information about the barebox
mailing list