From: Richard Levitte Date: Sat, 23 Jun 2001 14:51:53 +0000 (+0000) Subject: For the UI functions that return an int, 0 or any positive number is a X-Git-Tag: OpenSSL_0_9_6c~182^2~87 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=20e8f0ee27430f46b0d26a53786e9af25366dcc9;p=oweals%2Fopenssl.git For the UI functions that return an int, 0 or any positive number is a success return, any negative number is a failure. Make sure we check the return value with that in mind. --- diff --git a/crypto/engine/hw_ncipher.c b/crypto/engine/hw_ncipher.c index b2af378960..b6403aa666 100644 --- a/crypto/engine/hw_ncipher.c +++ b/crypto/engine/hw_ncipher.c @@ -1211,7 +1211,7 @@ static int hwcrhk_insert_card(const char *prompt_info, BIO_snprintf(buf, sizeof(buf)-1, "Current card: \"%s\"\n", wrong_info); ok = UI_dup_info_string(ui, buf); - if (ok && prompt_info) + if (ok >= 0 && prompt_info) { BIO_snprintf(buf, sizeof(buf)-1, "Insert card \"%s\"\n then hit or C to cancel\n", prompt_info); @@ -1219,13 +1219,13 @@ static int hwcrhk_insert_card(const char *prompt_info, answer, 0, sizeof(answer)-1); } UI_add_user_data(ui, callback_data); - if (ok) + if (ok >= 0) ok = UI_process(ui); UI_free(ui); /* If canceled input treat as 'cancel' */ if (ok == -2) ok = 1; - else if(ok != 0) + else if(ok < 0) ok = -1; else if (answer[0] == 'c' || answer[0] == 'C') ok = 1;