summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authortb <>2020-09-25 10:46:12 +0000
committertb <>2020-09-25 10:46:12 +0000
commitf26f6ab6f9af4ae819351d6220b9ae0f1054758f (patch)
tree955eec356962b66b71648c58ef002608749c2a2e /src/lib
parentd5311b6952fd15727b6ce34e0b122ed100fd08d7 (diff)
downloadopenbsd-f26f6ab6f9af4ae819351d6220b9ae0f1054758f.tar.gz
openbsd-f26f6ab6f9af4ae819351d6220b9ae0f1054758f.tar.bz2
openbsd-f26f6ab6f9af4ae819351d6220b9ae0f1054758f.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
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libcrypto/ui/ui_lib.c9
1 files changed, 4 insertions, 5 deletions
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 @@
1/* $OpenBSD: ui_lib.c,v 1.38 2020/09/24 19:31:01 tb Exp $ */ 1/* $OpenBSD: ui_lib.c,v 1.39 2020/09/25 10:46:12 tb Exp $ */
2/* Written by Richard Levitte (richard@levitte.org) for the OpenSSL 2/* Written by Richard Levitte (richard@levitte.org) for the OpenSSL
3 * project 2001. 3 * project 2001.
4 */ 4 */
@@ -393,8 +393,9 @@ UI_get0_result(UI *ui, int i)
393} 393}
394 394
395static int 395static int
396print_error(const char *str, size_t len, UI *ui) 396print_error(const char *str, size_t len, void *arg)
397{ 397{
398 UI *ui = arg;
398 UI_STRING uis; 399 UI_STRING uis;
399 400
400 memset(&uis, 0, sizeof(uis)); 401 memset(&uis, 0, sizeof(uis));
@@ -416,9 +417,7 @@ UI_process(UI *ui)
416 return -1; 417 return -1;
417 418
418 if (ui->flags & UI_FLAG_PRINT_ERRORS) 419 if (ui->flags & UI_FLAG_PRINT_ERRORS)
419 ERR_print_errors_cb( 420 ERR_print_errors_cb(print_error, ui);
420 (int (*)(const char *, size_t, void *)) print_error,
421 (void *)ui);
422 421
423 for (i = 0; i < sk_UI_STRING_num(ui->strings); i++) { 422 for (i = 0; i < sk_UI_STRING_num(ui->strings); i++) {
424 if (ui->meth->ui_write_string && 423 if (ui->meth->ui_write_string &&