summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortb <tb@openbsd.org>2020-09-25 10:46:12 +0000
committertb <tb@openbsd.org>2020-09-25 10:46:12 +0000
commita37673fd71297aa52b95863a35da1fdc2b662dff (patch)
treeba790e975abb5c1e5a9bf9452c99857889aad156
parentSimplify RB_TREE cleanup loops. (diff)
downloadwireguard-openbsd-a37673fd71297aa52b95863a35da1fdc2b662dff.tar.xz
wireguard-openbsd-a37673fd71297aa52b95863a35da1fdc2b662dff.zip
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
-rw-r--r--lib/libcrypto/ui/ui_lib.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/libcrypto/ui/ui_lib.c b/lib/libcrypto/ui/ui_lib.c
index 1045cb9992e..36cbba2e638 100644
--- a/lib/libcrypto/ui/ui_lib.c
+++ b/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 &&