From f26f6ab6f9af4ae819351d6220b9ae0f1054758f Mon Sep 17 00:00:00 2001 From: tb <> Date: Fri, 25 Sep 2020 10:46:12 +0000 Subject: Simplify call to ERR_print_errors_cb() There is no reason for print_error()'s third argument to be a UI *. It may just as well be a void * to match what ERR_print_errors_cb() expects. This avoids casting the function pointer. Also, there's no need for a (void *) cast. ok jsing --- src/lib/libcrypto/ui/ui_lib.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/lib') diff --git a/src/lib/libcrypto/ui/ui_lib.c b/src/lib/libcrypto/ui/ui_lib.c index 1045cb9992..36cbba2e63 100644 --- a/src/lib/libcrypto/ui/ui_lib.c +++ b/src/lib/libcrypto/ui/ui_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ui_lib.c,v 1.38 2020/09/24 19:31:01 tb Exp $ */ +/* $OpenBSD: ui_lib.c,v 1.39 2020/09/25 10:46:12 tb Exp $ */ /* Written by Richard Levitte (richard@levitte.org) for the OpenSSL * project 2001. */ @@ -393,8 +393,9 @@ UI_get0_result(UI *ui, int i) } static int -print_error(const char *str, size_t len, UI *ui) +print_error(const char *str, size_t len, void *arg) { + UI *ui = arg; UI_STRING uis; memset(&uis, 0, sizeof(uis)); @@ -416,9 +417,7 @@ UI_process(UI *ui) return -1; if (ui->flags & UI_FLAG_PRINT_ERRORS) - ERR_print_errors_cb( - (int (*)(const char *, size_t, void *)) print_error, - (void *)ui); + ERR_print_errors_cb(print_error, ui); for (i = 0; i < sk_UI_STRING_num(ui->strings); i++) { if (ui->meth->ui_write_string && -- cgit v1.2.3-55-g6feb