diff options
| author | tb <> | 2020-09-25 10:46:12 +0000 |
|---|---|---|
| committer | tb <> | 2020-09-25 10:46:12 +0000 |
| commit | e7ab003bf6d776e3b7e60d930414a50a6375989b (patch) | |
| tree | 955eec356962b66b71648c58ef002608749c2a2e /src/lib/libcrypto/ui/ui_lib.c | |
| parent | 0b96d4d35b0952539f92141a8abe70c107f8dae2 (diff) | |
| download | openbsd-e7ab003bf6d776e3b7e60d930414a50a6375989b.tar.gz openbsd-e7ab003bf6d776e3b7e60d930414a50a6375989b.tar.bz2 openbsd-e7ab003bf6d776e3b7e60d930414a50a6375989b.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/libcrypto/ui/ui_lib.c')
| -rw-r--r-- | src/lib/libcrypto/ui/ui_lib.c | 9 |
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 | ||
| 395 | static int | 395 | static int |
| 396 | print_error(const char *str, size_t len, UI *ui) | 396 | print_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 && |
