diff options
| author | markus <> | 2003-05-11 21:36:58 +0000 |
|---|---|---|
| committer | markus <> | 2003-05-11 21:36:58 +0000 |
| commit | 1c98a87f0daac81245653c227eb2f2508a22a965 (patch) | |
| tree | 3de6d603296ec563b936da4e6a8a1e33d48f8884 /src/lib/libcrypto/ui/ui_lib.c | |
| parent | 31392c89d1135cf2a416f97295f6d21681b3fbc4 (diff) | |
| download | openbsd-1c98a87f0daac81245653c227eb2f2508a22a965.tar.gz openbsd-1c98a87f0daac81245653c227eb2f2508a22a965.tar.bz2 openbsd-1c98a87f0daac81245653c227eb2f2508a22a965.zip | |
import 0.9.7b (without idea and rc5)
Diffstat (limited to 'src/lib/libcrypto/ui/ui_lib.c')
| -rw-r--r-- | src/lib/libcrypto/ui/ui_lib.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/lib/libcrypto/ui/ui_lib.c b/src/lib/libcrypto/ui/ui_lib.c index 16946cad95..13e5f20dcb 100644 --- a/src/lib/libcrypto/ui/ui_lib.c +++ b/src/lib/libcrypto/ui/ui_lib.c | |||
| @@ -62,6 +62,7 @@ | |||
| 62 | #include <openssl/ui.h> | 62 | #include <openssl/ui.h> |
| 63 | #include <openssl/err.h> | 63 | #include <openssl/err.h> |
| 64 | #include "ui_locl.h" | 64 | #include "ui_locl.h" |
| 65 | #include "cryptlib.h" | ||
| 65 | 66 | ||
| 66 | IMPLEMENT_STACK_OF(UI_STRING_ST) | 67 | IMPLEMENT_STACK_OF(UI_STRING_ST) |
| 67 | 68 | ||
| @@ -144,7 +145,8 @@ static UI_STRING *general_allocate_prompt(UI *ui, const char *prompt, | |||
| 144 | { | 145 | { |
| 145 | UIerr(UI_F_GENERAL_ALLOCATE_PROMPT,ERR_R_PASSED_NULL_PARAMETER); | 146 | UIerr(UI_F_GENERAL_ALLOCATE_PROMPT,ERR_R_PASSED_NULL_PARAMETER); |
| 146 | } | 147 | } |
| 147 | else if (result_buf == NULL) | 148 | else if ((type == UIT_PROMPT || type == UIT_VERIFY |
| 149 | || type == UIT_BOOLEAN) && result_buf == NULL) | ||
| 148 | { | 150 | { |
| 149 | UIerr(UI_F_GENERAL_ALLOCATE_PROMPT,UI_R_NO_RESULT_BUFFER); | 151 | UIerr(UI_F_GENERAL_ALLOCATE_PROMPT,UI_R_NO_RESULT_BUFFER); |
| 150 | } | 152 | } |
| @@ -235,7 +237,7 @@ static int general_allocate_boolean(UI *ui, | |||
| 235 | return ret; | 237 | return ret; |
| 236 | } | 238 | } |
| 237 | 239 | ||
| 238 | /* Returns the index to the place in the stack or 0 for error. Uses a | 240 | /* Returns the index to the place in the stack or -1 for error. Uses a |
| 239 | direct reference to the prompt. */ | 241 | direct reference to the prompt. */ |
| 240 | int UI_add_input_string(UI *ui, const char *prompt, int flags, | 242 | int UI_add_input_string(UI *ui, const char *prompt, int flags, |
| 241 | char *result_buf, int minsize, int maxsize) | 243 | char *result_buf, int minsize, int maxsize) |
| @@ -831,8 +833,8 @@ int UI_set_result(UI *ui, UI_STRING *uis, const char *result) | |||
| 831 | case UIT_PROMPT: | 833 | case UIT_PROMPT: |
| 832 | case UIT_VERIFY: | 834 | case UIT_VERIFY: |
| 833 | { | 835 | { |
| 834 | char number1[20]; | 836 | char number1[DECIMAL_SIZE(uis->_.string_data.result_minsize)+1]; |
| 835 | char number2[20]; | 837 | char number2[DECIMAL_SIZE(uis->_.string_data.result_maxsize)+1]; |
| 836 | 838 | ||
| 837 | BIO_snprintf(number1, sizeof(number1), "%d", | 839 | BIO_snprintf(number1, sizeof(number1), "%d", |
| 838 | uis->_.string_data.result_minsize); | 840 | uis->_.string_data.result_minsize); |
