Re: [PATCH v2 13/19] keytoc: Let openssl_error() take a format string

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 01.08.24 07:57, Sascha Hauer wrote:
> Make openssl_error() a bit more versatile.
> 
> Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>

Reviewed-by: Ahmad Fatoum <a.fatoum@xxxxxxxxxxxxxx>

> ---
>  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 |





[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux