diff options
Diffstat (limited to 'src/lib/libcrypto/ui/ui_lib.c')
| -rw-r--r-- | src/lib/libcrypto/ui/ui_lib.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/lib/libcrypto/ui/ui_lib.c b/src/lib/libcrypto/ui/ui_lib.c index baf86d7635..2c53f534e7 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.28 2014/07/22 02:21:20 beck Exp $ */ | 1 | /* $OpenBSD: ui_lib.c,v 1.29 2014/10/03 06:02:38 doug 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 | */ |
| @@ -386,7 +386,6 @@ UI_dup_error_string(UI *ui, const char *text) | |||
| 386 | char * | 386 | char * |
| 387 | UI_construct_prompt(UI *ui, const char *object_desc, const char *object_name) | 387 | UI_construct_prompt(UI *ui, const char *object_desc, const char *object_name) |
| 388 | { | 388 | { |
| 389 | const char *format = "Enter %s for %s:"; | ||
| 390 | char *prompt; | 389 | char *prompt; |
| 391 | 390 | ||
| 392 | if (ui->meth->ui_construct_prompt) | 391 | if (ui->meth->ui_construct_prompt) |
| @@ -395,10 +394,15 @@ UI_construct_prompt(UI *ui, const char *object_desc, const char *object_name) | |||
| 395 | 394 | ||
| 396 | if (object_desc == NULL) | 395 | if (object_desc == NULL) |
| 397 | return NULL; | 396 | return NULL; |
| 398 | if (object_name == NULL) | 397 | |
| 399 | format = "Enter %s:"; | 398 | if (object_name == NULL) { |
| 400 | if (asprintf(&prompt, format, object_desc, object_name) == -1) | 399 | if (asprintf(&prompt, "Enter %s:", object_desc) == -1) |
| 401 | return NULL; | 400 | return (NULL); |
| 401 | } else { | ||
| 402 | if (asprintf(&prompt, "Enter %s for %s:", object_desc, | ||
| 403 | object_name) == -1) | ||
| 404 | return (NULL); | ||
| 405 | } | ||
| 402 | 406 | ||
| 403 | return prompt; | 407 | return prompt; |
| 404 | } | 408 | } |
